Skip to content

Commit

Permalink
Merge "[tests] simplify tests collector"
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins-bot authored and Gerrit Code Review committed Jul 29, 2024
2 parents 4ed308f + c061846 commit b1372e9
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ def _unknown_test_modules():
extra_test_modules = _unknown_test_modules()

if 'PYWIKIBOT_TEST_MODULES' in os.environ:
_enabled_test_modules = os.environ['PYWIKIBOT_TEST_MODULES'].split(',')
disabled_test_modules = (library_test_modules
| extra_test_modules
| script_test_modules
- set(_enabled_test_modules))
enabled_test_modules = os.environ['PYWIKIBOT_TEST_MODULES'].split(',')
else:
enabled_test_modules = chain(library_test_modules,
extra_test_modules,
script_test_modules)


def unittest_print(*args, **kwargs):
Expand Down Expand Up @@ -218,9 +218,7 @@ def collector(loader=unittest.loader.defaultTestLoader):
f' {disabled_tests!r}')

modules = (module
for module in chain(library_test_modules,
extra_test_modules,
script_test_modules)
for module in enabled_test_modules
if module not in disabled_test_modules)

test_list = []
Expand Down

0 comments on commit b1372e9

Please sign in to comment.