MCPcopy Create free account
hub / github.com/ipython/ipython / test_get_ipython_dir_6

Function test_get_ipython_dir_6

IPython/core/tests/test_paths.py:133–150  ·  view source on GitHub ↗

test_get_ipython_dir_6, use home over XDG if defined and neither exist.

()

Source from the content-addressed store, hash-verified

131 nt.assert_equal(ipdir, IP_TEST_DIR)
132
133def test_get_ipython_dir_6():
134 """test_get_ipython_dir_6, use home over XDG if defined and neither exist."""
135 xdg = os.path.join(HOME_TEST_DIR, 'somexdg')
136 os.mkdir(xdg)
137 shutil.rmtree(os.path.join(HOME_TEST_DIR, '.ipython'))
138 print(paths._writable_dir)
139 with patch_get_home_dir(HOME_TEST_DIR), \
140 patch.object(paths, 'get_xdg_dir', return_value=xdg), \
141 patch('os.name', 'posix'), \
142 modified_env({
143 'IPYTHON_DIR': None,
144 'IPYTHONDIR': None,
145 'XDG_CONFIG_HOME': None,
146 }), warnings.catch_warnings(record=True) as w:
147 ipdir = paths.get_ipython_dir()
148
149 nt.assert_equal(ipdir, os.path.join(HOME_TEST_DIR, '.ipython'))
150 nt.assert_equal(len(w), 0)
151
152def test_get_ipython_dir_7():
153 """test_get_ipython_dir_7, test home directory expansion on IPYTHONDIR"""

Callers

nothing calls this directly

Calls 1

patch_get_home_dirFunction · 0.85

Tested by

no test coverage detected