[py-dev] How to run a given test by name?
baptiste.lepilleur at gmail.com
Sun May 1 12:41:06 CEST 2011
options -k was what I was looking for. I somehow managed to miss it.
2011/5/1 holger krekel <holger at merlinux.eu>
> On Sun, May 01, 2011 at 12:08 +0200, Baptiste Lepilleur wrote:
> > typically when troubleshooting multiple test failures, I want to be able
> > run a single parametrized test case.
> > How can you tell py.test to run only tests matching a specific name.
> > For example, I'd like to be able to run:
> > py.test src --filter-by-name "test_mandatory_property[ZText]"
> > This would run all tests with a name
> > matching "test_mandatory_property[ZText]".
> > Is there a way to do that?
> two possibilites. You can do a run with "py.test -rf" which will report
> test IDs
> for all failures. You can then pass one or more of those IDs to a py.test
> Secondly you can use the keyword option try something like "-k ZTEXT", see
> option help.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pytest-dev