mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-30167: Add test for module.__cached__ is None (GH-7617)
This commit is contained in:
parent
cd602b8af2
commit
d4c76d960b
1 changed files with 11 additions and 0 deletions
|
@ -389,6 +389,17 @@ class ImportSideEffectTests(unittest.TestCase):
|
|||
"expected absolute path, got {}"
|
||||
.format(os__cached__.decode('ascii')))
|
||||
|
||||
def test_abs_paths_cached_None(self):
|
||||
"""Test for __cached__ is None.
|
||||
|
||||
Regarding to PEP 3147, __cached__ can be None.
|
||||
|
||||
See also: https://bugs.python.org/issue30167
|
||||
"""
|
||||
sys.modules['test'].__cached__ = None
|
||||
site.abs_paths()
|
||||
self.assertIsNone(sys.modules['test'].__cached__)
|
||||
|
||||
def test_no_duplicate_paths(self):
|
||||
# No duplicate paths should exist in sys.path
|
||||
# Handled by removeduppaths()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue