mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Update importlib.invalidate_caches() to be more general.
This commit is contained in:
parent
9a4d7ddb6c
commit
b46a1793a7
5 changed files with 62 additions and 38 deletions
|
@ -143,6 +143,13 @@ class FinderTests(abc.FinderTests):
|
|||
finally:
|
||||
os.unlink('mod.py')
|
||||
|
||||
def test_invalidate_caches(self):
|
||||
# invalidate_caches() should reset the mtime.
|
||||
finder = _bootstrap._FileFinder('', _bootstrap._SourceFinderDetails())
|
||||
finder._path_mtime = 42
|
||||
finder.invalidate_caches()
|
||||
self.assertEqual(finder._path_mtime, -1)
|
||||
|
||||
|
||||
def test_main():
|
||||
from test.support import run_unittest
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue