Excluding several tests with --test produce unexpected result
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zope.testrunner |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Say that you have the following tests available:
test_foo
test_bar
And you try to run zope.testrunner with the following options:
--test="!foo" --test="!bar"
You will get the following tests executed:
test_foo
test_bar
The culprit is the way tests patterns are matched with test names:
* "!foo" builds a pattern which says "return True if it doesn't contain foo"
* same for "!bar"
Then, in https:/
* is "foo" not in "test_foo" -> False
* is "bar" not in "test_foo" -> True, yield it
...
* is "foo" not in "test_bar" -> True, yield it
I'm not sure how to fix the algorithm to fix the problem.
I posted a fix at https:/ /github. com/zopefoundat ion/zope. testrunner/ pull/2