[openstack-dev] Issues when running unit tests in OpenStack
victor stinner
victor.stinner at enovance.com
Tue Apr 8 09:19:03 UTC 2014
Sylvain Bauza wrote:
>> (2) When a test fails, it's hard to find the command to rerun a single
>> failing test.
> (...)
>
> See the wiki page I gave to you. Some helpful tricks are there. That said, I
> never had the issue you mentioned related to only checking one unittest by
> providing the path.
> When I'm isolating one test, tox -epy27 <pattern> is enough for me.
For the "parameter ignore", here is an example with Oslo Incubator (which uses testr, at least for Python 2):
$ tox -e py27
...
FAIL: tests.unit.test_timeutils.TestIso8601Time.test_west_normalize
...
Ran 8675 (+8673) tests in 16.137s (+16.083s)
...
$ tox -e py27 tests.unit.test_timeutils.TestIso8601Time.test_west_normalize
...
FAIL: tests.unit.test_timeutils.TestIso8601Time.test_west_normalize
...
Ran 8675 (+8455) tests in 17.250s (-39.332s)
> You can run testtools without testr. Nosetests has been marked as
> non-supported, IIRC.
Oslo Incubator runs unit tests using nosetests. I tried to use testr, but it fails on Python 3 because the openstack.common.eventlet_backdoor module cannot be loaded (eventlet is not available on Python 3).
How can I ignore openstack.common.eventlet_backdoor using testr? I understood that testr first loads all modules and then filter them using the regex.
Victor
More information about the OpenStack-dev
mailing list