From 32c30cb8003213005c65436f1ac1d0955fa210cc Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Thu, 12 Jun 2014 14:41:29 -0700 Subject: [PATCH] Switch from nose to pytest Nicer output when asserts fail Also more actively maintained and more flexible (e.g.: fixtures, conftest.py) --- .gitignore | 3 +++ pytest.ini | 14 ++++++++++++++ tests/{pipdeptree_tests.py => test_pipdeptree.py} | 0 tox.ini | 5 +++-- 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 pytest.ini rename tests/{pipdeptree_tests.py => test_pipdeptree.py} (100%) diff --git a/.gitignore b/.gitignore index 56032d1..bfe2aa4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ __pycache__ build/ dist/ .tox/ +.coverage +coverage.xml +htmlcov/ diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..5f45b74 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,14 @@ +[pytest] +norecursedirs = build docs/_build *.egg .tox *.venv virtualenvs +addopts = + # --verbose + --tb=short + # Turn on --capture to have brief, less noisy output + # You will only see output if the test fails + # Use --capture no if you want to see it all or have problems debugging + # --capture=fd + # --capture=no + # show extra test summary info as specified by chars (f)ailed, (E)error, (s)skipped, (x)failed, (X)passed. + -rfEsxX + # --junitxml=junit.xml + # --cov=pipdeptree --cov-report=xml --cov-report=html --cov-report=term-missing diff --git a/tests/pipdeptree_tests.py b/tests/test_pipdeptree.py similarity index 100% rename from tests/pipdeptree_tests.py rename to tests/test_pipdeptree.py diff --git a/tox.ini b/tox.ini index c3c1844..2324d6e 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,7 @@ envlist = py27, py32 [testenv] -commands = nosetests tests/ +commands = py.test {posargs:--cov pipdeptree --cov-report xml --cov-report html --cov-report term-missing tests/} deps = - nose + pytest + pytest-cov