summaryrefslogtreecommitdiff
path: root/Lib/importlib/test
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-02-20 01:48:16 +0100
committerAntoine Pitrou <solipsis@pitrou.net>2012-02-20 01:48:16 +0100
commitab0490950e51c9b7e652761f409b8267b6abb458 (patch)
treec06c41660ea8503c21fe54f54a607897c6aa7939 /Lib/importlib/test
parentc744cf037db6fb8f0af5c02098e97b4e8657e392 (diff)
downloadcpython-ab0490950e51c9b7e652761f409b8267b6abb458.tar.gz
Issue #14043: Speed up importlib's _FileFinder by at least 8x, and add a new importlib.invalidate_caches() function.
importlib is now often faster than imp.find_module() at finding modules.
Diffstat (limited to 'Lib/importlib/test')
-rw-r--r--Lib/importlib/test/import_/test_path.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/importlib/test/import_/test_path.py b/Lib/importlib/test/import_/test_path.py
index 61fe2260d4..5713319612 100644
--- a/Lib/importlib/test/import_/test_path.py
+++ b/Lib/importlib/test/import_/test_path.py
@@ -78,11 +78,11 @@ class FinderTests(unittest.TestCase):
path = ''
module = '<test module>'
importer = util.mock_modules(module)
- hook = import_util.mock_path_hook(os.getcwd(), importer=importer)
+ hook = import_util.mock_path_hook(os.curdir, importer=importer)
with util.import_state(path=[path], path_hooks=[hook]):
loader = machinery.PathFinder.find_module(module)
self.assertIs(loader, importer)
- self.assertIn(os.getcwd(), sys.path_importer_cache)
+ self.assertIn(os.curdir, sys.path_importer_cache)
class DefaultPathFinderTests(unittest.TestCase):