Show More
@@ -68,7 +68,7 b' def test_get_ipython_dir_2():' | |||
|
68 | 68 | assert ipdir == os.path.join("someplace", ".ipython") |
|
69 | 69 | |
|
70 | 70 | def test_get_ipython_dir_3(): |
|
71 |
"""test_get_ipython_dir_3, |
|
|
71 | """test_get_ipython_dir_3, use XDG if defined and exists, and .ipython doesn't exist.""" | |
|
72 | 72 | tmphome = TemporaryDirectory() |
|
73 | 73 | try: |
|
74 | 74 | with patch_get_home_dir(tmphome.name), \ |
@@ -80,10 +80,8 b' def test_get_ipython_dir_3():' | |||
|
80 | 80 | }), warnings.catch_warnings(record=True) as w: |
|
81 | 81 | ipdir = paths.get_ipython_dir() |
|
82 | 82 | |
|
83 |
assert ipdir == os.path.join(tmphome.name, " |
|
|
84 | if sys.platform != 'darwin': | |
|
85 | assert len(w) == 1 | |
|
86 | assert "Moving" in str(w[0]) | |
|
83 | assert ipdir == os.path.join(tmphome.name, XDG_TEST_DIR, "ipython") | |
|
84 | assert len(w) == 0 | |
|
87 | 85 | finally: |
|
88 | 86 | tmphome.cleanup() |
|
89 | 87 | |
@@ -105,10 +103,8 b' def test_get_ipython_dir_4():' | |||
|
105 | 103 | }), warnings.catch_warnings(record=True) as w: |
|
106 | 104 | ipdir = paths.get_ipython_dir() |
|
107 | 105 | |
|
108 | assert ipdir == os.path.join(HOME_TEST_DIR, ".ipython") | |
|
109 | if sys.platform != 'darwin': | |
|
110 | assert len(w) == 1 | |
|
111 | assert "Ignoring" in str(w[0]) | |
|
106 | assert len(w) == 1 | |
|
107 | assert "Ignoring" in str(w[0]) | |
|
112 | 108 | |
|
113 | 109 | |
|
114 | 110 | def test_get_ipython_dir_5(): |
@@ -179,7 +175,7 b' def test_get_ipython_dir_8():' | |||
|
179 | 175 | |
|
180 | 176 | def test_get_ipython_cache_dir(): |
|
181 | 177 | with modified_env({'HOME': HOME_TEST_DIR}): |
|
182 |
if os.name == |
|
|
178 | if os.name == "posix": | |
|
183 | 179 | # test default |
|
184 | 180 | os.makedirs(os.path.join(HOME_TEST_DIR, ".cache")) |
|
185 | 181 | with modified_env({'XDG_CACHE_HOME': None}): |
@@ -228,11 +228,11 b' def test_get_xdg_dir_2():' | |||
|
228 | 228 | |
|
229 | 229 | @with_environment |
|
230 | 230 | def test_get_xdg_dir_3(): |
|
231 |
"""test_get_xdg_dir_3, check xdg_dir not used on |
|
|
231 | """test_get_xdg_dir_3, check xdg_dir not used on non-posix systems""" | |
|
232 | 232 | reload(path) |
|
233 | 233 | path.get_home_dir = lambda : HOME_TEST_DIR |
|
234 |
os.name = " |
|
|
235 |
sys.platform = " |
|
|
234 | os.name = "nt" | |
|
235 | sys.platform = "win32" | |
|
236 | 236 | env.pop('IPYTHON_DIR', None) |
|
237 | 237 | env.pop('IPYTHONDIR', None) |
|
238 | 238 | env.pop('XDG_CONFIG_HOME', None) |
General Comments 0
You need to be logged in to leave comments.
Login now