Kaydet (Commit) ecac6d7a authored tarafından Tom Forbes's avatar Tom Forbes Kaydeden (comit) Tim Graham

Improved performance of runtests.py with os.scandir().

üst d5e52f2b
...@@ -96,12 +96,12 @@ def get_test_modules(): ...@@ -96,12 +96,12 @@ def get_test_modules():
SUBDIRS_TO_SKIP.append('gis_tests') SUBDIRS_TO_SKIP.append('gis_tests')
for modpath, dirpath in discovery_paths: for modpath, dirpath in discovery_paths:
for f in os.listdir(dirpath): for f in os.scandir(dirpath):
if ('.' not in f and if ('.' not in f.name and
os.path.basename(f) not in SUBDIRS_TO_SKIP and os.path.basename(f.name) not in SUBDIRS_TO_SKIP and
not os.path.isfile(f) and not f.is_file() and
os.path.exists(os.path.join(dirpath, f, '__init__.py'))): os.path.exists(os.path.join(f.path, '__init__.py'))):
modules.append((modpath, f)) modules.append((modpath, f.name))
return modules return modules
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment