Skip to content

Commit e63e755

Browse files
committed
runtests: typecheck libpython just once
1 parent 137186c commit e63e755

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

runtests.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,14 @@ def add_libpython(driver: Driver) -> None:
226226
seen = set() # type: Set[str]
227227
for version in driver.versions:
228228
libpython_dir = join(driver.cwd, 'lib-python', version)
229+
modules = [] # type: List[str]
229230
for f in find_files(libpython_dir, prefix='test_', suffix='.py'):
230231
module = file_to_module(f[len(libpython_dir) + 1:])
231232
if module not in seen:
232233
seen.add(module)
233-
driver.add_mypy_modules(
234-
'libpython (%s) module %s' % (version, module),
235-
[module],
236-
cwd=libpython_dir)
234+
modules.append(module)
235+
if modules:
236+
driver.add_mypy_modules('libpython (%s)' % (version,), modules, cwd=libpython_dir)
237237

238238

239239
def add_samples(driver: Driver) -> None:

0 commit comments

Comments
 (0)