diff options
| author | Tom Forbes <tom@tomforb.es> | 2019-06-26 05:44:10 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-06-26 06:44:10 +0200 |
| commit | 8454f6dea49dddb821bfcb7569ea222bb487dfd1 (patch) | |
| tree | 9edde9702497d00d929f54c8490953f72770ca25 /tests | |
| parent | 698df6a009cb1c4dbd55905264f24f6edf41066e (diff) | |
Fixed #30588 -- Fixed crash of autoreloader when __main__ module doesn't have __file__ attribute.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/utils_tests/test_autoreload.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/utils_tests/test_autoreload.py b/tests/utils_tests/test_autoreload.py index f130d216cc..1ea019ac7a 100644 --- a/tests/utils_tests/test_autoreload.py +++ b/tests/utils_tests/test_autoreload.py @@ -136,6 +136,10 @@ class TestIterModulesAndFiles(SimpleTestCase): main_module = sys.modules['__main__'] self.assertFileFound(Path(main_module.__file__)) + def test_main_module_without_file_is_not_resolved(self): + fake_main = types.ModuleType('__main__') + self.assertEqual(autoreload.iter_modules_and_files((fake_main,), frozenset()), frozenset()) + class TestCommonRoots(SimpleTestCase): def test_common_roots(self): |
