[openstack-dev] [OpenStack][python-quantumclient] running tox in python-quantumclient
Robert Collins
robertc at robertcollins.net
Sun Jun 23 23:50:56 UTC 2013
The parameter is not a filename, it is a regex to match tests on, and
if you select no tests, then none will run.
What is your test name? Put that in:
tox -v epy27 $testname
(also, you shouldn't need to run unittests under sudo).
-Rob
On 24 June 2013 07:16, Kuang-Ching Wang <kuangching.wang at gmail.com> wrote:
> Hi,
>
> I am trying to run a unit test for a module I am developing. When I did the
> following, it showed commands passed, but in fact my test is not being run
> since even if I put random bogus file names or bugs in the test, it still
> shows passed.
>
> under python-quantumclient/, I did the following. Note I intentionally
> placed a non-existent file name test_cli20_firewall_policys.py instead of
> the real name test_cli20_firewall_policy.py.
>
> nova at nova:/opt/stack/python-quantumclient$ sudo tox -v -epy27
> tests.unit.test_cli20_firewall_policys.py
> using tox.ini: /opt/stack/python-quantumclient/tox.ini
> using tox-1.4.3 from /usr/local/lib/python2.7/dist-packages/tox/__init__.pyc
> GLOB sdist-make: /opt/stack/python-quantumclient/setup.py
> /opt/stack/python-quantumclient$ /usr/bin/python
> /opt/stack/python-quantumclient/setup.py sdist --formats=zip --dist-dir
> /opt/stack/python-quantumclient/.tox/dist
>>/opt/stack/python-quantumclient/.tox/log/tox-0.log
> py27 reusing: /opt/stack/python-quantumclient/.tox/py27
> py27 inst-nodeps:
> /opt/stack/python-quantumclient/.tox/dist/python-quantumclient-2.2.2a.3.g4ebf9f2.zip
> /opt/stack/python-quantumclient/.tox/py27/log$
> /opt/stack/python-quantumclient/.tox/py27/bin/pip install
> /opt/stack/python-quantumclient/.tox/dist/python-quantumclient-2.2.2a.3.g4ebf9f2.zip
> -U --no-deps >/opt/stack/python-quantumclient/.tox/py27/log/py27-20.log
> py27 runtests: commands[0]
> /opt/stack/python-quantumclient$
> /opt/stack/python-quantumclient/.tox/py27/bin/python setup.py testr
> --testr-args=tests.unit.test_cli20_firewall_policys.py
> running testr
> running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m
> subunit.run discover -t ./ ./tests --list
> PASSED (id=17)
> _________________________________________________ summary
> __________________________________________________
> py27: commands succeeded
> congratulations :)
>
>
>
> Thanks,
> KC
>
>
>
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
--
Robert Collins <rbtcollins at hp.com>
Distinguished Technologist
HP Cloud Services
More information about the OpenStack-dev
mailing list