From bdb3581a52f018a489abca0a4fc676f3f09da111 Mon Sep 17 00:00:00 2001 From: Omar Kohl Date: Sun, 20 Mar 2016 13:18:17 +0100 Subject: [PATCH] Fix minor mistake in test discovery doc The example output shown was for Python3 not Python2. Add Python2 output and rephrase for clarity. --- doc/en/example/pythoncollection.rst | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/doc/en/example/pythoncollection.rst b/doc/en/example/pythoncollection.rst index 5faf4c6c8..6edab15a8 100644 --- a/doc/en/example/pythoncollection.rst +++ b/doc/en/example/pythoncollection.rst @@ -177,16 +177,27 @@ and a setup.py dummy file like this:: # content of setup.py 0/0 # will raise exception if imported -then a pytest run on python2 will find the one test when run with a python2 -interpreters and will leave out the setup.py file:: +then a pytest run on Python2 will find the one test and will leave out the +setup.py file:: $ py.test --collect-only - ======= test session starts ======== - platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1 + ====== test session starts ====== + platform linux2 -- Python 2.7.10, pytest-2.9.1, py-1.4.31, pluggy-0.3.1 + rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini + collected 1 items + + + + ====== no tests ran in 0.04 seconds ====== + +If you run with a Python3 interpreter both the one test and the setup.py file +will be left out:: + + $ py.test --collect-only + ====== test session starts ====== + platform linux -- Python 3.4.3+, pytest-2.9.1, py-1.4.31, pluggy-0.3.1 rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini collected 0 items - - ======= no tests ran in 0.12 seconds ======== -If you run with a Python3 interpreter the moduled added through the conftest.py file will not be considered for test collection. + ====== no tests ran in 0.03 seconds ======