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

Function test_module_without_init

IPython/core/tests/test_completerlib.py:164–178  ·  view source on GitHub ↗

Test module without __init__.py. https://github.com/ipython/ipython/issues/11226

()

Source from the content-addressed store, hash-verified

162
163
164def test_module_without_init():
165 """
166 Test module without __init__.py.
167
168 https://github.com/ipython/ipython/issues/11226
169 """
170 fake_module_name = "foo"
171 with TemporaryDirectory() as tmpdir:
172 sys.path.insert(0, tmpdir)
173 try:
174 os.makedirs(os.path.join(tmpdir, fake_module_name))
175 s = try_import(mod=fake_module_name)
176 assert s == []
177 finally:
178 sys.path.remove(tmpdir)

Callers

nothing calls this directly

Calls 2

try_importFunction · 0.90
removeMethod · 0.45

Tested by

no test coverage detected