@@ -177,16 +177,27 @@ and a setup.py dummy file like this::
177
177
# content of setup.py
178
178
0/0 # will raise exception if imported
179
179
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::
182
182
183
183
$ 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
186
199
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
187
200
collected 0 items
188
-
189
- ======= no tests ran in 0.12 seconds ========
190
201
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 ======
192
203
0 commit comments