From 1073884ba6b89587ab5d29f0245aca949483eee7 Mon Sep 17 00:00:00 2001 From: Paul Cutler Date: Wed, 3 Oct 2018 08:53:36 -0500 Subject: Change references to "py.test" to "pytest" in installation.rst As of pytest 3.0 (Aug 16) the recommended way to call pytest is using the "pytest" command and not "py.test" --- docs/tutorials/wiki/installation.rst | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'docs') diff --git a/docs/tutorials/wiki/installation.rst b/docs/tutorials/wiki/installation.rst index 7f914267f..ddbe30906 100644 --- a/docs/tutorials/wiki/installation.rst +++ b/docs/tutorials/wiki/installation.rst @@ -195,22 +195,22 @@ Run the tests After you've installed the project in development mode as well as the testing requirements, you may run the tests for the project. The following commands -provide options to py.test that specify the module for which its tests shall be -run, and to run py.test in quiet mode. +provide options to :term:`pytest` that specify the module for which its tests shall be +run, and to run ``pytest`` in quiet mode. On Unix ^^^^^^^ .. code-block:: bash - $VENV/bin/py.test -q + $VENV/bin/pytest -q On Windows ^^^^^^^^^^ .. code-block:: doscon - %VENV%\Scripts\py.test -q + %VENV%\Scripts\pytest -q For a successful test run, you should see output that ends like this: @@ -223,8 +223,8 @@ For a successful test run, you should see output that ends like this: Expose test coverage information -------------------------------- -You can run the ``py.test`` command to see test coverage information. This -runs the tests in the same way that ``py.test`` does, but provides additional +You can run the ``pytest`` command to see test coverage information. This +runs the tests in the same way that ``pytest`` does, but provides additional :term:`coverage` information, exposing which lines of your project are covered by the tests. @@ -236,14 +236,14 @@ On Unix .. code-block:: bash - $VENV/bin/py.test --cov --cov-report=term-missing + $VENV/bin/pytest --cov --cov-report=term-missing On Windows ^^^^^^^^^^ .. code-block:: doscon - %VENV%\Scripts\py.test --cov --cov-report=term-missing + %VENV%\Scripts\pytest --cov --cov-report=term-missing If successful, you will see output something like this: @@ -275,7 +275,7 @@ Our package doesn't quite have 100% test coverage. Test and coverage cookiecutter defaults --------------------------------------- -Cookiecutters include configuration defaults for ``py.test`` and test coverage. +Cookiecutters include configuration defaults for ``pytest`` and test coverage. These configuration files are ``pytest.ini`` and ``.coveragerc``, located at the root of your package. Without these defaults, we would need to specify the path to the module on which we want to run tests and coverage. @@ -285,22 +285,22 @@ On Unix .. code-block:: bash - $VENV/bin/py.test --cov=tutorial tutorial/tests.py -q + $VENV/bin/pytest --cov=tutorial tutorial/tests.py -q On Windows ^^^^^^^^^^ .. code-block:: doscon - %VENV%\Scripts\py.test --cov=tutorial tutorial\tests.py -q + %VENV%\Scripts\pytest --cov=tutorial tutorial\tests.py -q -py.test follows :ref:`conventions for Python test discovery +``pytest`` follows :ref:`conventions for Python test discovery `, and the configuration defaults from the cookiecutter -tell ``py.test`` where to find the module on which we want to run tests and +tell ``pytest`` where to find the module on which we want to run tests and coverage. -.. seealso:: See py.test's documentation for :ref:`pytest:usage` or invoke - ``py.test -h`` to see its full set of options. +.. seealso:: See pytest's documentation for :ref:`pytest:usage` or invoke + ``pytest -h`` to see its full set of options. .. _wiki-start-the-application: -- cgit v1.2.3 From 8035dd8857b447e1fd8e2e2ea70f924a5c56d40f Mon Sep 17 00:00:00 2001 From: Paul Cutler Date: Wed, 3 Oct 2018 09:15:14 -0500 Subject: Change references to "py.test" to "pytest" in installation.rst Remove :term: from pytest as it is not in the glossary. --- docs/tutorials/wiki/installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/tutorials/wiki/installation.rst b/docs/tutorials/wiki/installation.rst index ddbe30906..cfd61a867 100644 --- a/docs/tutorials/wiki/installation.rst +++ b/docs/tutorials/wiki/installation.rst @@ -195,7 +195,7 @@ Run the tests After you've installed the project in development mode as well as the testing requirements, you may run the tests for the project. The following commands -provide options to :term:`pytest` that specify the module for which its tests shall be +provide options to `pytest` that specify the module for which its tests shall be run, and to run ``pytest`` in quiet mode. On Unix -- cgit v1.2.3 From 5cc53de8dd0da263b053b3e96f3014e207cb5331 Mon Sep 17 00:00:00 2001 From: Paul Cutler Date: Wed, 3 Oct 2018 09:25:09 -0500 Subject: Change references to "py.test" to "pytest" in SQLAlchemy tutorial Change all references of "py.test" to "pytest" per pytest 3.0 release in the SQLAlchemy + URL Dispatch tutorial --- docs/tutorials/wiki2/installation.rst | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'docs') diff --git a/docs/tutorials/wiki2/installation.rst b/docs/tutorials/wiki2/installation.rst index 5f2c6d44e..8860ad8a9 100644 --- a/docs/tutorials/wiki2/installation.rst +++ b/docs/tutorials/wiki2/installation.rst @@ -342,22 +342,22 @@ Run the tests After you've installed the project in development mode as well as the testing requirements, you may run the tests for the project. The following commands -provide options to py.test that specify the module for which its tests shall be -run, and to run py.test in quiet mode. +provide options to ``pytest`` that specify the module for which its tests shall be +run, and to run ``pytest`` in quiet mode. On Unix ^^^^^^^ .. code-block:: bash - $VENV/bin/py.test -q + $VENV/bin/pytest -q On Windows ^^^^^^^^^^ .. code-block:: doscon - %VENV%\Scripts\py.test -q + %VENV%\Scripts\pytest -q For a successful test run, you should see output that ends like this: @@ -370,8 +370,8 @@ For a successful test run, you should see output that ends like this: Expose test coverage information -------------------------------- -You can run the ``py.test`` command to see test coverage information. This -runs the tests in the same way that ``py.test`` does, but provides additional +You can run the ``pytest`` command to see test coverage information. This +runs the tests in the same way that ``pytest`` does, but provides additional :term:`coverage` information, exposing which lines of your project are covered by the tests. @@ -383,14 +383,14 @@ On Unix .. code-block:: bash - $VENV/bin/py.test --cov --cov-report=term-missing + $VENV/bin/pytest --cov --cov-report=term-missing On Windows ^^^^^^^^^^ .. code-block:: doscon - c:\tutorial> %VENV%\Scripts\py.test --cov --cov-report=term-missing + c:\tutorial> %VENV%\Scripts\pytest --cov --cov-report=term-missing If successful, you will see output something like this: @@ -429,7 +429,7 @@ Our package doesn't quite have 100% test coverage. Test and coverage cookiecutter defaults --------------------------------------- -Cookiecutters include configuration defaults for ``py.test`` and test coverage. +Cookiecutters include configuration defaults for ``pytest`` and test coverage. These configuration files are ``pytest.ini`` and ``.coveragerc``, located at the root of your package. Without these defaults, we would need to specify the path to the module on which we want to run tests and coverage. @@ -439,22 +439,22 @@ On Unix .. code-block:: bash - $VENV/bin/py.test --cov=tutorial tutorial/tests.py -q + $VENV/bin/pytest --cov=tutorial tutorial/tests.py -q On Windows ^^^^^^^^^^ .. code-block:: doscon - %VENV%\Scripts\py.test --cov=tutorial tutorial\tests.py -q + %VENV%\Scripts\pytest --cov=tutorial tutorial\tests.py -q -py.test follows :ref:`conventions for Python test discovery +pytest follows :ref:`conventions for Python test discovery `, and the configuration defaults from the cookiecutter -tell ``py.test`` where to find the module on which we want to run tests and +tell ``pytest`` where to find the module on which we want to run tests and coverage. -.. seealso:: See py.test's documentation for :ref:`pytest:usage` or invoke - ``py.test -h`` to see its full set of options. +.. seealso:: See pytest's documentation for :ref:`pytest:usage` or invoke + ``pytest -h`` to see its full set of options. .. _wiki2-start-the-application: -- cgit v1.2.3 From 36d48753abf23f109f2616a3b83f482d63781f7e Mon Sep 17 00:00:00 2001 From: Paul Cutler Date: Wed, 3 Oct 2018 09:27:31 -0500 Subject: Change references to "py.test" to "pytest" in ZODB tutorial test page Change all references of "py.test" to "pytest" per pytest 3.0 release in the test page of the ZODB + Traversal tutorial --- docs/tutorials/wiki/tests.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/tutorials/wiki/tests.rst b/docs/tutorials/wiki/tests.rst index c3a1ca79a..6c7f24645 100644 --- a/docs/tutorials/wiki/tests.rst +++ b/docs/tutorials/wiki/tests.rst @@ -51,22 +51,22 @@ follows: Running the tests ================= -We can run these tests by using ``py.test`` similarly to how we did in +We can run these tests by using ``pytest`` similarly to how we did in :ref:`running_tests`. Courtesy of the cookiecutter, our testing dependencies have -already been satisfied and ``py.test`` and coverage have already been +already been satisfied and ``pytest`` and coverage have already been configured, so we can jump right to running tests. On Unix: .. code-block:: bash - $VENV/bin/py.test -q + $VENV/bin/pytest -q On Windows: .. code-block:: doscon - %VENV%\Scripts\py.test -q + %VENV%\Scripts\pytest -q The expected result should look like the following: -- cgit v1.2.3 From 72c1c87fc5c44bc5a68dd49915953db3fb60e213 Mon Sep 17 00:00:00 2001 From: Paul Cutler Date: Wed, 3 Oct 2018 09:29:27 -0500 Subject: Change references to "py.test" in SQLAlchemy tutorial test page Change all references of "py.test" to "pytest" per pytest 3.0 release in the test page of the ZODB + URL Dispatch tutorial test documentation --- docs/tutorials/wiki2/tests.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/tutorials/wiki2/tests.rst b/docs/tutorials/wiki2/tests.rst index f3f89fe9c..fb33fc629 100644 --- a/docs/tutorials/wiki2/tests.rst +++ b/docs/tutorials/wiki2/tests.rst @@ -99,14 +99,14 @@ On Unix: .. code-block:: bash rm tutorial.sqlite - $VENV/bin/py.test -q + $VENV/bin/pytest -q On Windows: .. code-block:: doscon del tutorial.sqlite - %VENV%\Scripts\py.test -q + %VENV%\Scripts\pytest -q The expected result should look like the following: -- cgit v1.2.3 From 171593c8c851ae0d0eafc7ff84e35e367a725b12 Mon Sep 17 00:00:00 2001 From: Paul Cutler Date: Wed, 3 Oct 2018 09:33:09 -0500 Subject: Change references to "py.test" in SQLAlchemy tutorial test page Change the references of "py.test" to "pytest" per pytest 3.0 release in the Jinja2 template page of the documentation in quick tutorial --- docs/quick_tutorial/jinja2.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/quick_tutorial/jinja2.rst b/docs/quick_tutorial/jinja2.rst index 87122a374..6c33e406e 100644 --- a/docs/quick_tutorial/jinja2.rst +++ b/docs/quick_tutorial/jinja2.rst @@ -50,7 +50,7 @@ Steps .. code-block:: bash - $VENV/bin/py.test tutorial/tests.py -q + $VENV/bin/pytest tutorial/tests.py -q .... 4 passed in 0.40 seconds -- cgit v1.2.3 From f6333267acdd10bc38eee161c5e64bbf212fe555 Mon Sep 17 00:00:00 2001 From: Paul Cutler Date: Wed, 3 Oct 2018 09:39:52 -0500 Subject: Change references to "py.test" in Quick Tutorial Unit Test page Change the references of "py.test" to "pytest" per pytest 3.0 release in the Unit Test and pytest page of the documentation in quick tutorial --- docs/quick_tutorial/unit_testing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/quick_tutorial/unit_testing.rst b/docs/quick_tutorial/unit_testing.rst index 09e3ea197..48cffd0e1 100644 --- a/docs/quick_tutorial/unit_testing.rst +++ b/docs/quick_tutorial/unit_testing.rst @@ -62,7 +62,7 @@ Steps .. code-block:: bash - $VENV/bin/py.test tutorial/tests.py -q + $VENV/bin/pytest tutorial/tests.py -q . 1 passed in 0.14 seconds @@ -96,7 +96,7 @@ Extra credit ============ #. Change the test to assert that the response status code should be ``404`` - (meaning, not found). Run ``py.test`` again. Read the error report and see + (meaning, not found). Run ``pytest`` again. Read the error report and see if you can decipher what it is telling you. #. As a more realistic example, put the ``tests.py`` back as you found it, and -- cgit v1.2.3 From c5d3424fe640f0e848078402da2027b7d9b7d00e Mon Sep 17 00:00:00 2001 From: Paul Cutler Date: Wed, 3 Oct 2018 09:49:26 -0500 Subject: Change references to "py.test" in all Quick Tutorial documentation Change all references of "py.test" to "pytest" per pytest 3.0 release in the Quick Tutorial documentation --- docs/quick_tutorial/databases.rst | 4 ++-- docs/quick_tutorial/forms.rst | 2 +- docs/quick_tutorial/json.rst | 2 +- docs/quick_tutorial/logging.rst | 2 +- docs/quick_tutorial/more_view_classes.rst | 2 +- docs/quick_tutorial/request_response.rst | 2 +- docs/quick_tutorial/routing.rst | 2 +- docs/quick_tutorial/sessions.rst | 2 +- docs/quick_tutorial/static_assets.rst | 2 +- docs/quick_tutorial/templating.rst | 2 +- docs/quick_tutorial/view_classes.rst | 2 +- docs/quick_tutorial/views.rst | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) (limited to 'docs') diff --git a/docs/quick_tutorial/databases.rst b/docs/quick_tutorial/databases.rst index 7d10f2470..5e318187d 100644 --- a/docs/quick_tutorial/databases.rst +++ b/docs/quick_tutorial/databases.rst @@ -128,11 +128,11 @@ Steps .. literalinclude:: databases/tutorial/tests.py :linenos: -#. Run the tests in your package using ``py.test``: +#. Run the tests in your package using ``pytest``: .. code-block:: bash - $VENV/bin/py.test tutorial/tests.py -q + $VENV/bin/pytest tutorial/tests.py -q .. 2 passed in 1.41 seconds diff --git a/docs/quick_tutorial/forms.rst b/docs/quick_tutorial/forms.rst index be745764b..f064a4baf 100644 --- a/docs/quick_tutorial/forms.rst +++ b/docs/quick_tutorial/forms.rst @@ -91,7 +91,7 @@ Steps .. code-block:: bash - $VENV/bin/py.test tutorial/tests.py -q + $VENV/bin/pytest tutorial/tests.py -q .. 2 passed in 0.45 seconds diff --git a/docs/quick_tutorial/json.rst b/docs/quick_tutorial/json.rst index 98283424c..44d1de8cb 100644 --- a/docs/quick_tutorial/json.rst +++ b/docs/quick_tutorial/json.rst @@ -54,7 +54,7 @@ Steps .. code-block:: bash - $VENV/bin/py.test tutorial/tests.py -q + $VENV/bin/pytest tutorial/tests.py -q ..... 5 passed in 0.47 seconds diff --git a/docs/quick_tutorial/logging.rst b/docs/quick_tutorial/logging.rst index ccbb7970f..f4a368bfa 100644 --- a/docs/quick_tutorial/logging.rst +++ b/docs/quick_tutorial/logging.rst @@ -54,7 +54,7 @@ Steps .. code-block:: bash - $VENV/bin/py.test tutorial/tests.py -q + $VENV/bin/pytest tutorial/tests.py -q .... 4 passed in 0.41 seconds diff --git a/docs/quick_tutorial/more_view_classes.rst b/docs/quick_tutorial/more_view_classes.rst index 15452e9ae..684fb1c43 100644 --- a/docs/quick_tutorial/more_view_classes.rst +++ b/docs/quick_tutorial/more_view_classes.rst @@ -105,7 +105,7 @@ Steps .. code-block:: bash - $VENV/bin/py.test tutorial/tests.py -q + $VENV/bin/pytest tutorial/tests.py -q .. 2 passed in 0.40 seconds diff --git a/docs/quick_tutorial/request_response.rst b/docs/quick_tutorial/request_response.rst index 098753820..f7753f222 100644 --- a/docs/quick_tutorial/request_response.rst +++ b/docs/quick_tutorial/request_response.rst @@ -61,7 +61,7 @@ Steps .. code-block:: bash - $VENV/bin/py.test tutorial/tests.py -q + $VENV/bin/pytest tutorial/tests.py -q ..... 5 passed in 0.30 seconds diff --git a/docs/quick_tutorial/routing.rst b/docs/quick_tutorial/routing.rst index 0384892b2..a6538a75f 100644 --- a/docs/quick_tutorial/routing.rst +++ b/docs/quick_tutorial/routing.rst @@ -79,7 +79,7 @@ Steps .. code-block:: bash - $VENV/bin/py.test tutorial/tests.py -q + $VENV/bin/pytest tutorial/tests.py -q .. 2 passed in 0.39 seconds diff --git a/docs/quick_tutorial/sessions.rst b/docs/quick_tutorial/sessions.rst index d67a5063a..8a67d6a0f 100644 --- a/docs/quick_tutorial/sessions.rst +++ b/docs/quick_tutorial/sessions.rst @@ -60,7 +60,7 @@ Steps .. code-block:: bash - $VENV/bin/py.test tutorial/tests.py -q + $VENV/bin/pytest tutorial/tests.py -q .... 4 passed in 0.42 seconds diff --git a/docs/quick_tutorial/static_assets.rst b/docs/quick_tutorial/static_assets.rst index 7a6b5dac3..567328307 100644 --- a/docs/quick_tutorial/static_assets.rst +++ b/docs/quick_tutorial/static_assets.rst @@ -54,7 +54,7 @@ Steps .. code-block:: bash - $VENV/bin/py.test tutorial/tests.py -q + $VENV/bin/pytest tutorial/tests.py -q .... 5 passed in 0.50 seconds diff --git a/docs/quick_tutorial/templating.rst b/docs/quick_tutorial/templating.rst index 3fbef699c..4d4ccea4f 100644 --- a/docs/quick_tutorial/templating.rst +++ b/docs/quick_tutorial/templating.rst @@ -92,7 +92,7 @@ Steps .. code-block:: bash - $VENV/bin/py.test tutorial/tests.py -q + $VENV/bin/pytest tutorial/tests.py -q .... 4 passed in 0.46 seconds diff --git a/docs/quick_tutorial/view_classes.rst b/docs/quick_tutorial/view_classes.rst index fc7ba5125..4b7b78140 100644 --- a/docs/quick_tutorial/view_classes.rst +++ b/docs/quick_tutorial/view_classes.rst @@ -61,7 +61,7 @@ Steps .. code-block:: bash - $VENV/bin/py.test tutorial/tests.py -q + $VENV/bin/pytest tutorial/tests.py -q .... 4 passed in 0.34 seconds diff --git a/docs/quick_tutorial/views.rst b/docs/quick_tutorial/views.rst index f7fa64719..45bc8518b 100644 --- a/docs/quick_tutorial/views.rst +++ b/docs/quick_tutorial/views.rst @@ -68,7 +68,7 @@ Steps .. code-block:: bash - $VENV/bin/py.test tutorial/tests.py -q + $VENV/bin/pytest tutorial/tests.py -q .... 4 passed in 0.28 seconds -- cgit v1.2.3 From 0f9ea0cd3fd99aade91160c6fe833b7295b85254 Mon Sep 17 00:00:00 2001 From: Paul Cutler Date: Wed, 3 Oct 2018 09:52:33 -0500 Subject: Change references to "py.test" in Typographical Conventions Change reference of "py.test" to "pytest" per pytest 3.0 release in the Typographical Conventions documentation page --- docs/typographical-conventions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/typographical-conventions.rst b/docs/typographical-conventions.rst index 76fdf8ace..7f052cbc8 100644 --- a/docs/typographical-conventions.rst +++ b/docs/typographical-conventions.rst @@ -128,7 +128,7 @@ When a command that should be typed on one line is too long to fit on the displa .. code-block:: bash - $VENV/bin/py.test tutorial/tests.py --cov-report term-missing \ + $VENV/bin/pytest tutorial/tests.py --cov-report term-missing \ --cov=tutorial -q -- cgit v1.2.3 From d363b4ef2ac1463df99993841749c536aacbd07f Mon Sep 17 00:00:00 2001 From: Paul Cutler Date: Wed, 3 Oct 2018 09:54:27 -0500 Subject: Change references to "py.test" in Quick Tour Change reference of "py.test" to "pytest" per pytest 3.0 release in the Quick Tour documentation page --- docs/quick_tour.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/quick_tour.rst b/docs/quick_tour.rst index 26195a701..123bd3a51 100644 --- a/docs/quick_tour.rst +++ b/docs/quick_tour.rst @@ -675,7 +675,7 @@ the relevant ``.ini`` configuration file. :ref:`Quick Tutorial pyramid_debugtoolbar ` and :ref:`pyramid_debugtoolbar ` -Unit tests and ``py.test`` +Unit tests and ``pytest`` ========================== Yikes! We got this far and we haven't yet discussed tests. This is particularly @@ -684,7 +684,7 @@ before its release. Our ``pyramid-cookiecutter-starter`` cookiecutter generated a ``tests.py`` module with one unit test and one functional test in it. It also configured ``setup.py`` with test requirements: -``py.test`` as the test runner, ``WebTest`` for running view tests, and the +``pytest`` as the test runner, ``WebTest`` for running view tests, and the ``pytest-cov`` tool which yells at us for code that isn't tested: .. literalinclude:: quick_tour/package/setup.py @@ -701,7 +701,7 @@ We already installed the test requirements when we ran the command ``$VENV/bin/p .. code-block:: bash - $VENV/bin/py.test --cov --cov-report=term-missing + $VENV/bin/pytest --cov --cov-report=term-missing This yields the following output. -- cgit v1.2.3 From f9c3ff6db52f107f298852b92ecc945fbc26229c Mon Sep 17 00:00:00 2001 From: Paul Cutler Date: Wed, 3 Oct 2018 10:06:48 -0500 Subject: Change references to "py.test" in narrative documentation Change reference of "py.test" to "pytest" per pytest 3.0 release in the project and testing pages of narrative documentation --- docs/narr/project.rst | 24 ++++++++++++------------ docs/narr/testing.rst | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'docs') diff --git a/docs/narr/project.rst b/docs/narr/project.rst index fb5a241db..a15138207 100644 --- a/docs/narr/project.rst +++ b/docs/narr/project.rst @@ -239,26 +239,26 @@ On Windows: %VENV%\Scripts\pip install -e ".[testing]" Once the testing requirements are installed, then you can run the tests using -the ``py.test`` command that was just installed in the ``bin`` directory of +the ``pytest`` command that was just installed in the ``bin`` directory of your virtual environment. On Unix: .. code-block:: bash - $VENV/bin/py.test -q + $VENV/bin/pytest -q On Windows: .. code-block:: doscon - %VENV%\Scripts\py.test -q + %VENV%\Scripts\pytest -q Here's sample output from a test run on Unix: .. code-block:: bash - $VENV/bin/py.test -q + $VENV/bin/pytest -q .. 2 passed in 0.47 seconds @@ -266,28 +266,28 @@ The tests themselves are found in the ``tests.py`` module in your ``cookiecutter .. note:: - The ``-q`` option is passed to the ``py.test`` command to limit the output + The ``-q`` option is passed to the ``pytest`` command to limit the output to a stream of dots. If you don't pass ``-q``, you'll see verbose test result output (which normally isn't very useful). Alternatively, if you'd like to see test coverage, pass the ``--cov`` option -to ``py.test``: +to ``pytest``: .. code-block:: bash - $VENV/bin/py.test --cov -q + $VENV/bin/pytest --cov -q -Cookiecutters include configuration defaults for ``py.test`` and test coverage. +Cookiecutters include configuration defaults for ``pytest`` and test coverage. These configuration files are ``pytest.ini`` and ``.coveragerc``, located at the root of your package. Without these defaults, we would need to specify the path to the module on which we want to run tests and coverage. .. code-block:: bash - $VENV/bin/py.test --cov=myproject myproject/tests.py -q + $VENV/bin/pytest --cov=myproject myproject/tests.py -q -.. seealso:: See py.test's documentation for :ref:`pytest:usage` or invoke - ``py.test -h`` to see its full set of options. +.. seealso:: See pytest's documentation for :ref:`pytest:usage` or invoke + ``pytest -h`` to see its full set of options. .. index:: @@ -1042,7 +1042,7 @@ The ``tests.py`` module includes tests for your application. :linenos: This sample ``tests.py`` file has one unit test and one functional test defined -within it. These tests are executed when you run ``py.test -q``. You may add +within it. These tests are executed when you run ``pytest -q``. You may add more tests here as you build your application. You are not required to write tests to use :app:`Pyramid`. This file is simply provided for convenience and example. diff --git a/docs/narr/testing.rst b/docs/narr/testing.rst index ad4ba2186..8048ca62c 100644 --- a/docs/narr/testing.rst +++ b/docs/narr/testing.rst @@ -275,7 +275,7 @@ without needing to invoke the actual application configuration implied by its In the above example, we create a ``MyTest`` test case that inherits from :class:`unittest.TestCase`. If it's in our :app:`Pyramid` application, it will -be found when ``py.test`` is run. It has two test methods. +be found when ``pytest`` is run. It has two test methods. The first test method, ``test_view_fn_forbidden`` tests the ``view_fn`` when the authentication policy forbids the current user the ``edit`` permission. Its @@ -365,7 +365,7 @@ Functional tests test your literal application. In Pyramid, functional tests are typically written using the :term:`WebTest` package, which provides APIs for invoking HTTP(S) requests to your application. -We also like ``py.test`` and ``pytest-cov`` to provide simple testing and +We also like ``pytest`` and ``pytest-cov`` to provide simple testing and coverage reports. Regardless of which testing :term:`package` you use, be sure to add a -- cgit v1.2.3 From 9c39f657e9edbb59ef83a375500596f500c70a44 Mon Sep 17 00:00:00 2001 From: Paul Cutler Date: Thu, 4 Oct 2018 11:02:14 -0500 Subject: Update Pyramid documentation pytest references with feedback Update the pull request to update all Pyramid documentation to replace instances of "py.test" with "pytest" to include missing backticks where needed. --- docs/narr/project.rst | 2 +- docs/quick_tour.rst | 2 +- docs/tutorials/wiki/installation.rst | 4 ++-- docs/tutorials/wiki2/installation.rst | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/narr/project.rst b/docs/narr/project.rst index a15138207..5efc07e09 100644 --- a/docs/narr/project.rst +++ b/docs/narr/project.rst @@ -286,7 +286,7 @@ path to the module on which we want to run tests and coverage. $VENV/bin/pytest --cov=myproject myproject/tests.py -q -.. seealso:: See pytest's documentation for :ref:`pytest:usage` or invoke +.. seealso:: See ``pytest``'s documentation for :ref:`pytest:usage` or invoke ``pytest -h`` to see its full set of options. diff --git a/docs/quick_tour.rst b/docs/quick_tour.rst index 123bd3a51..1e46aa367 100644 --- a/docs/quick_tour.rst +++ b/docs/quick_tour.rst @@ -676,7 +676,7 @@ the relevant ``.ini`` configuration file. :ref:`pyramid_debugtoolbar ` Unit tests and ``pytest`` -========================== +========================= Yikes! We got this far and we haven't yet discussed tests. This is particularly egregious, as Pyramid has had a deep commitment to full test coverage since diff --git a/docs/tutorials/wiki/installation.rst b/docs/tutorials/wiki/installation.rst index cfd61a867..639aa0881 100644 --- a/docs/tutorials/wiki/installation.rst +++ b/docs/tutorials/wiki/installation.rst @@ -195,7 +195,7 @@ Run the tests After you've installed the project in development mode as well as the testing requirements, you may run the tests for the project. The following commands -provide options to `pytest` that specify the module for which its tests shall be +provide options to ``pytest`` that specify the module for which its tests shall be run, and to run ``pytest`` in quiet mode. On Unix @@ -299,7 +299,7 @@ On Windows tell ``pytest`` where to find the module on which we want to run tests and coverage. -.. seealso:: See pytest's documentation for :ref:`pytest:usage` or invoke +.. seealso:: See ``pytest``'s documentation for :ref:`pytest:usage` or invoke ``pytest -h`` to see its full set of options. diff --git a/docs/tutorials/wiki2/installation.rst b/docs/tutorials/wiki2/installation.rst index 8860ad8a9..b2f1dde4a 100644 --- a/docs/tutorials/wiki2/installation.rst +++ b/docs/tutorials/wiki2/installation.rst @@ -453,7 +453,7 @@ pytest follows :ref:`conventions for Python test discovery tell ``pytest`` where to find the module on which we want to run tests and coverage. -.. seealso:: See pytest's documentation for :ref:`pytest:usage` or invoke +.. seealso:: See ``pytest``'s documentation for :ref:`pytest:usage` or invoke ``pytest -h`` to see its full set of options. -- cgit v1.2.3