Skip to content
Myr

py.test => pytest (#2173)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

py.test => pytest

authored by vojtekb · committed by Markus Unterwaditzer · parent 9e2807d · Browse files · 5 files+10 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+10 added−10 removed

  • other:+10 added−10 removed

5 files+10 added−10 removed

modified:docs/tutorial/testing.rst+1 added-1 removed
44 unmodified lines
4546Run and watch the tests pass, within the top-level :file:`flaskr/` 47directory as::4849 py.test49 pytest5051Testing + setuptools52--------------------53
43 unmodified lines
modified:CONTRIBUTING.rst+5 added-5 removed
36 unmodified lines
3738You probably want to set up a `virtualenv39<https://virtualenv.readthedocs.io/en/latest/index.html>`_.4041The minimal requirement for running the testsuite is ``py.test``. You can41The minimal requirement for running the testsuite is ``pytest``. You can42install it with::4344 pip install pytest45
7 unmodified lines
53 pip install --editable .5455Then you can run the testsuite with::5657 py.test57 pytest5859With only py.test installed, a large part of the testsuite will get skipped59With only pytest installed, a large part of the testsuite will get skipped60though. Whether this is relevant depends on which part of Flask you're working61on. Travis is set up to run the full testsuite when you submit your pull62request anyways.63
14 unmodified lines
78 pip install pytest-cov7980After this has been installed, you can output a report to the command line using this command::8182 py.test --cov=flask tests/82 pytest --cov=flask tests/8384Generate a HTML report can be done using this command::8586 py.test --cov-report html --cov=flask tests/86 pytest --cov-report html --cov=flask tests/8788Full docs on ``coverage.py`` are here: https://coverage.readthedocs.io8990Caution
24 unmodified lines
modified:README+2 added-2 removed
31 unmodified lines
32 ~ Where are the tests?3334 Good that you're asking. The tests are in the35 tests/ folder. To run the tests use the36 `py.test` testing tool:36 `pytest` testing tool:3738 $ py.test38 $ pytest3940 Details on contributing can be found in CONTRIBUTING.rst4142 ~ Where can I get help?
7 unmodified lines
modified:setup.cfg+1 added-1 removed
6 unmodified lines
7[metadata]8license_file = LICENSE910[tool:pytest]11norecursedirs = .* *.egg *.egg-info env* artwork docs11norecursedirs = .* *.egg *.egg-info env* artwork docs examples
modified:tox.ini+1 added-1 removed
9 unmodified lines
10 # We need to install those after Flask is installed.11 pip install -e examples/flaskr12 pip install -e examples/minitwit13 pip install -e examples/patterns/largerapp14 py.test --cov=flask --cov-report html []14 pytest --cov=flask --cov-report html []15deps=16 pytest17 pytest-cov18 greenlet
15 unmodified lines