Skip to content

Commit bdb3581

Browse files
committed
Fix minor mistake in test discovery doc
The example output shown was for Python3 not Python2. Add Python2 output and rephrase for clarity.
1 parent 27b6274 commit bdb3581

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

doc/en/example/pythoncollection.rst

+18-7
Original file line numberDiff line numberDiff line change
@@ -177,16 +177,27 @@ and a setup.py dummy file like this::
177177
# content of setup.py
178178
0/0 # will raise exception if imported
179179

180-
then a pytest run on python2 will find the one test when run with a python2
181-
interpreters and will leave out the setup.py file::
180+
then a pytest run on Python2 will find the one test and will leave out the
181+
setup.py file::
182182

183183
$ py.test --collect-only
184-
======= test session starts ========
185-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
184+
====== test session starts ======
185+
platform linux2 -- Python 2.7.10, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
186+
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
187+
collected 1 items
188+
<Module 'pkg/module_py2.py'>
189+
<Function 'test_only_on_python2'>
190+
191+
====== no tests ran in 0.04 seconds ======
192+
193+
If you run with a Python3 interpreter both the one test and the setup.py file
194+
will be left out::
195+
196+
$ py.test --collect-only
197+
====== test session starts ======
198+
platform linux -- Python 3.4.3+, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
186199
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
187200
collected 0 items
188-
189-
======= no tests ran in 0.12 seconds ========
190201

191-
If you run with a Python3 interpreter the moduled added through the conftest.py file will not be considered for test collection.
202+
====== no tests ran in 0.03 seconds ======
192203

0 commit comments

Comments
 (0)