Excluding several tests with --test produce unexpected result

Bug #1160965 reported by Jonathan Ballet
6
This bug affects 1 person
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://github.com/zopefoundation/zope.testrunner/blob/master/src/zope/testrunner/find.py#L422, it goes as follow:

* 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.

Revision history for this message
Jonathan Ballet (multani) wrote :
Changed in zope.testrunner:
status: New → In Progress
Revision history for this message
Jonathan Ballet (multani) wrote :
Changed in zope.testrunner:
status: In Progress → Fix Committed
Revision history for this message
Marius Gedminas (mgedmin) wrote :

Fixed in zope.testrunner 4.4.0.

Changed in zope.testrunner:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.