diff --git a/docs/Developers/Executing_Tests.rst b/docs/Developers/Executing_Tests.rst index 599f1cab83..e65d08d3ea 100644 --- a/docs/Developers/Executing_Tests.rst +++ b/docs/Developers/Executing_Tests.rst @@ -34,10 +34,10 @@ You can then execute our tests with :: - $ py.test + $ pytest .. note:: - If ``py.test`` seems to give errors, try running ``python3 -m pytest`` + If ``pytest`` seems to give errors, try running ``python3 -m pytest`` instead. and report any errors you get! @@ -48,11 +48,11 @@ To run our tests, you can also use ``python3 setup.py test`` If you need to customize test running, you can get more options about allowing skipped tests, getting code coverage displayed - or omitting/selecting tests using ``py.test`` directly. + or omitting/selecting tests using ``pytest`` directly. :: - $ py.test --help + $ pytest --help .. note:: @@ -66,12 +66,12 @@ To get coverage information, you can run: :: - $ py.test --cov + $ pytest --cov You can view the coverage report as html by running: :: - $ py.test --cov --cov-report html + $ pytest --cov --cov-report html The html report will be saved ``.htmlreport`` inside the coala repository. diff --git a/docs/Developers/Writing_Tests.rst b/docs/Developers/Writing_Tests.rst index b72eeddeb3..1d43829eb7 100644 --- a/docs/Developers/Writing_Tests.rst +++ b/docs/Developers/Writing_Tests.rst @@ -30,28 +30,27 @@ automatically executed by running: :: - $ py.test + $ pytest There's only one constraint: The name of the test file has to end with ``Test.py`` (for example ``MyCustomTest.py``, but not ``MyCustomTestSuite.py``). .. note:: - If ``py.test`` seems to give errors, try running ``python3 -m pytest`` + If ``pytest`` seems to give errors, try running ``python3 -m pytest`` instead. -.. note:: Often you don't want to run all available tests. To run your specific one, type (in the coala root folder): .. code:: shell - $ py.test -k + $ pytest -k You can even give partial names or queries like "not MyCustomTest" to not run a specific test. More information can be got with - ``py.test -h`` + ``pytest -h`` Coming to the test file structure. Every test script starts with your imports. According to the coala code style (and pep8 style) we first do @@ -129,7 +128,7 @@ So an example test that succeeds would be: The branch coverage can be measured locally with the - ``py.test --cov`` command. + ``pytest --cov`` command. .. seealso:: @@ -187,7 +186,7 @@ as a kickstart for test-writing. Put the code under the desired folder inside ``tests``, modify it to let it test your stuff and run the test from -the coala root folder ``py.test``. +the coala root folder ``pytest``. .. code:: python