diff options
author | Brett Cannon <brett@python.org> | 2012-02-27 23:15:42 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2012-02-27 23:15:42 (GMT) |
commit | b46a1793a787747d59e735e12471b3a309aa51da (patch) | |
tree | 61eacabf46212791ef3fa96f44c95c9593c8607d /Lib/importlib/test/source | |
parent | 9a4d7ddb6c09af03953840ff8a2c1215fc6742a7 (diff) | |
download | cpython-b46a1793a787747d59e735e12471b3a309aa51da.zip cpython-b46a1793a787747d59e735e12471b3a309aa51da.tar.gz cpython-b46a1793a787747d59e735e12471b3a309aa51da.tar.bz2 |
Update importlib.invalidate_caches() to be more general.
Diffstat (limited to 'Lib/importlib/test/source')
-rw-r--r-- | Lib/importlib/test/source/test_finder.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/importlib/test/source/test_finder.py b/Lib/importlib/test/source/test_finder.py index 7b9088d..68e9ae7 100644 --- a/Lib/importlib/test/source/test_finder.py +++ b/Lib/importlib/test/source/test_finder.py @@ -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 |