Show More
@@ -16,7 +16,7 b' from os.path import join' | |||
|
16 | 16 | |
|
17 | 17 | import nose.tools as nt |
|
18 | 18 | |
|
19 | from IPython.core.completerlib import magic_run_completer, module_completion | |
|
19 | from IPython.core.completerlib import magic_run_completer, module_completion, try_import | |
|
20 | 20 | from IPython.utils.tempdir import TemporaryDirectory |
|
21 | 21 | from IPython.testing.decorators import onlyif_unicode_paths |
|
22 | 22 | |
@@ -159,3 +159,17 b' def test_bad_module_all():' | |||
|
159 | 159 | nt.assert_is_instance(r, str) |
|
160 | 160 | finally: |
|
161 | 161 | sys.path.remove(testsdir) |
|
162 | ||
|
163 | ||
|
164 | def 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 | os.makedirs(os.path.join(tmpdir, fake_module_name)) | |
|
174 | s = try_import(mod=fake_module_name) | |
|
175 | assert s == [] |
General Comments 0
You need to be logged in to leave comments.
Login now