Skip to content

Commit

Permalink
Fix: let -at-level=level with level <= 0 run the tests at all lev…
Browse files Browse the repository at this point in the history
…els (rather than no level)
  • Loading branch information
d-maurer committed Sep 5, 2022
1 parent eab00d6 commit 932dfa8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGES.rst
Expand Up @@ -5,7 +5,10 @@
5.6 (unreleased)
================

- Nothing changed yet.
- Fix: let ``--at-level=level`` with ``level <= 0`` run the tests
at all levels (rather than at no level)
`#138 <https://github.com/zopefoundation/zope.testrunner/issues/138>`_.



5.5 (2022-06-24)
Expand Down
2 changes: 1 addition & 1 deletion src/zope/testrunner/find.py
Expand Up @@ -468,7 +468,7 @@ def tests_from_suite(suite, options, dlevel=1,
duplicated_test_ids.add(suite_id)
else:
seen_test_ids.add(suite_id)
if level <= options.at_level:
if options.at_level <= 0 or level <= options.at_level:
if accept is None or accept(str(suite)):
yield (suite, layer)

Expand Down
2 changes: 1 addition & 1 deletion src/zope/testrunner/options.py
Expand Up @@ -135,7 +135,7 @@ def _regex_search(s):
default=1,
help="""\
Run the tests at the given level. Any test at a level at or below
this is run, any test at a level above this is not run. Level 0
this is run, any test at a level above this is not run. Level <= 0
runs all tests.
""")

Expand Down

0 comments on commit 932dfa8

Please sign in to comment.