Skip to content

Instantly share code, notes, and snippets.

@4383
Last active June 5, 2020 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 4383/36d3b98a5ee37104effe7678f0385a55 to your computer and use it in GitHub Desktop.
Save 4383/36d3b98a5ee37104effe7678f0385a55 to your computer and use it in GitHub Desktop.
tox debug

Run only a specific test with tox:

$ tox -e py38 -- oslo_service.tests.test_wsgi.TestWSGIServerWithSSL.test_ssl_server

Run command in a virtualenv managed by tox:

$ tox -e venv -- <command>

Use pdb on a specific unit test with tox:

$ # first you should import pdb in your test/code
$ tox -e venv -- python -m testtools.run oslo_service.tests.test_wsgi.TestWSGIServerWithSSL.test_ssl_server

Watch listening sockets and connections during test execution:

$ watch -n 5 'echo -e "Listen:\n" && netstat -tunlp | grep python && echo -e "\nConnections:\n" && ss -4tnp | grep python'
$ tox -e venv -- python -m testtools.run oslo_service.tests.test_wsgi.TestWSGIServerWithSSL.test_ssl_server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment