From ce313520cf3db17dce72d4c67dde36f6715b62c4 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Thu, 13 Oct 2016 19:00:29 +0100 Subject: [PATCH] [tox] use `--pyargs fontTools` to run tests against package installed in tox env instead of source dir This will ensure we don't forget to add any data files to the MANIFEST.in (which means test data is not available to the inlined tests). {posargs} allows to pass extra arguments to the test runner, when runing `tox -- {posargs}` from the command line. With `--pyargs` option, pytest tries to interpret arguments as python package/module names, and if import fails as regular filesystem paths. --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 65355b259..11c02feda 100644 --- a/tox.ini +++ b/tox.ini @@ -16,8 +16,8 @@ commands = # check that we have the expected Python version and architecture {envpython} -c "import sys; print(sys.version)" {envpython} -c "import struct; print(struct.calcsize('P') * 8)" - # run the test suite - py.test {posargs} + # run the test suite against the package installed inside tox env + py.test {posargs:--pyargs fontTools} [testenv:coveralls] passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH