summaryrefslogtreecommitdiff
path: root/tox.ini
diff options
context:
space:
mode:
authorBryce Guinta <bryce.paul.guinta@gmail.com>2018-02-12 22:05:37 -0700
committerBryce Guinta <bryce.paul.guinta@gmail.com>2018-02-14 21:11:20 -0700
commitacb75a052e243f730de85228ea091441624ce554 (patch)
treea985542f33c8be443a758886baa85ee77d5f4533 /tox.ini
parent5688add28711414aa05c943eee539702fd3c1d07 (diff)
downloadastroid-git-acb75a052e243f730de85228ea091441624ce554.tar.gz
Use pytest as default test runner instead of unittest for tox
There was some trouble getting this to work. I needed to use --pyargs for pytest to work in tox Allow for test file prefix unittest_ to be changed to standard test_ Helps with updating the astroid tests to standard pytest conventions Make pytest use proper test directory by default
Diffstat (limited to 'tox.ini')
-rw-r--r--tox.ini6
1 files changed, 5 insertions, 1 deletions
diff --git a/tox.ini b/tox.ini
index 29c00fb8..2ce5080e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -27,7 +27,11 @@ setenv =
COVERAGE_FILE = {toxinidir}/.coverage.{envname}
commands =
- python -Wi -m coverage run -m unittest {posargs: discover -s astroid/tests -p "unittest*.py"}
+ ; --pyargs is needed so the directory astroid doesn't shadow the tox
+ ; installed astroid package
+ ; This is important for tests' test data which create files
+ ; inside the package
+ python -Wi {envsitepackagesdir}/coverage run -m pytest --pyargs astroid {posargs:}
; Transform absolute path to relative path
; for compatibility with coveralls.io and fix 'source not available' error.
; If you can find a cleaner way is welcome