Jonas H. <jo...@lophus.org> added the comment:

Just to be clear, the current implementation is limited to substring matches. 
It doesn't support py.test like "and/or" combinators. (Actually, py.test uses 
'eval' to support arbitrary patterns.)

So say we have test case

SomeClass
    test_foo
    test_bar

Then

- python -m unittest -k fo matches "test_foo"
- python -m unittest -k Some matches "test_foo" and "test_bar"
- python -m unittest -k some matches nothing

The -k option may be used multiple times, combining the patterns with "or":

- python -m unittest -k fo -k b matches "test_foo" and "test_bar"

It's also possible to use glob-style patterns, like -k "spam_*_eggs".

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32071>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to