Use pathlib for file ios, because the new parso is out

This commit is contained in:
Dave Halter
2020-08-05 00:52:50 +02:00
parent 94bf83c826
commit f12ed2088a
6 changed files with 17 additions and 14 deletions

View File

@@ -15,7 +15,7 @@ from test.helpers import test_dir, get_example_dir
def test_preload_modules():
def check_loaded(*modules):
def check_loaded(*module_names):
for grammar_cache in cache.parser_cache.values():
if None in grammar_cache:
break
@@ -25,9 +25,9 @@ def test_preload_modules():
if path is not None and str(path).startswith(str(typeshed.TYPESHED_PATH))
)
# +1 for None module (currently used)
assert len(grammar_cache) - typeshed_cache_count == len(modules) + 1
for i in modules:
assert [i in k for k in grammar_cache.keys() if k is not None]
assert len(grammar_cache) - typeshed_cache_count == len(module_names) + 1
for i in module_names:
assert [i in str(k) for k in grammar_cache.keys() if k is not None]
old_cache = cache.parser_cache.copy()
cache.parser_cache.clear()