Skip to content

Commit 77c2882

Browse files
regendoc and comment out a python2.7 example as per pytest-dev#1573
1 parent d3dcc2b commit 77c2882

16 files changed

+91
-92
lines changed

doc/en/assert.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ you will see the return value of the function call::
2626

2727
$ py.test test_assert1.py
2828
======= test session starts ========
29-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
29+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
3030
rootdir: $REGENDOC_TMPDIR, inifile:
3131
collected 1 items
3232
@@ -143,7 +143,7 @@ if you run this module::
143143

144144
$ py.test test_assert2.py
145145
======= test session starts ========
146-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
146+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
147147
rootdir: $REGENDOC_TMPDIR, inifile:
148148
collected 1 items
149149
@@ -156,7 +156,7 @@ if you run this module::
156156
set1 = set("1308")
157157
set2 = set("8035")
158158
> assert set1 == set2
159-
E assert set(['0', '1', '3', '8']) == set(['0', '3', '5', '8'])
159+
E assert {'0', '1', '3', '8'} == {'0', '3', '5', '8'}
160160
E Extra items in the left set:
161161
E '1'
162162
E Extra items in the right set:

doc/en/cache.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ If you then run it with ``--lf``::
8080

8181
$ py.test --lf
8282
======= test session starts ========
83-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
83+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
8484
run-last-failure: rerun last 2 failures
8585
rootdir: $REGENDOC_TMPDIR, inifile:
8686
collected 50 items
@@ -121,7 +121,7 @@ of ``FF`` and dots)::
121121

122122
$ py.test --ff
123123
======= test session starts ========
124-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
124+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
125125
run-last-failure: rerun last 2 failures first
126126
rootdir: $REGENDOC_TMPDIR, inifile:
127127
collected 50 items
@@ -226,7 +226,7 @@ You can always peek at the content of the cache using the
226226

227227
$ py.test --cache-clear
228228
======= test session starts ========
229-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
229+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
230230
rootdir: $REGENDOC_TMPDIR, inifile:
231231
collected 1 items
232232

doc/en/capture.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ of the failing function and hide the other one::
6464

6565
$ py.test
6666
======= test session starts ========
67-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
67+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
6868
rootdir: $REGENDOC_TMPDIR, inifile:
6969
collected 2 items
7070

doc/en/doctest.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ then you can just invoke ``py.test`` without command line options::
4949

5050
$ py.test
5151
======= test session starts ========
52-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
52+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
5353
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
5454
collected 1 items
5555

doc/en/example/markers.rst

+20-16
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ You can then restrict a test run to only run tests marked with ``webtest``::
3131

3232
$ py.test -v -m webtest
3333
======= test session starts ========
34-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
34+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
3535
cachedir: .cache
3636
rootdir: $REGENDOC_TMPDIR, inifile:
3737
collecting ... collected 4 items
@@ -45,7 +45,7 @@ Or the inverse, running all tests except the webtest ones::
4545

4646
$ py.test -v -m "not webtest"
4747
======= test session starts ========
48-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
48+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
4949
cachedir: .cache
5050
rootdir: $REGENDOC_TMPDIR, inifile:
5151
collecting ... collected 4 items
@@ -66,7 +66,7 @@ tests based on their module, class, method, or function name::
6666

6767
$ py.test -v test_server.py::TestClass::test_method
6868
======= test session starts ========
69-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
69+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
7070
cachedir: .cache
7171
rootdir: $REGENDOC_TMPDIR, inifile:
7272
collecting ... collected 5 items
@@ -79,7 +79,7 @@ You can also select on the class::
7979

8080
$ py.test -v test_server.py::TestClass
8181
======= test session starts ========
82-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
82+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
8383
cachedir: .cache
8484
rootdir: $REGENDOC_TMPDIR, inifile:
8585
collecting ... collected 4 items
@@ -92,7 +92,7 @@ Or select multiple nodes::
9292

9393
$ py.test -v test_server.py::TestClass test_server.py::test_send_http
9494
======= test session starts ========
95-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
95+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
9696
cachedir: .cache
9797
rootdir: $REGENDOC_TMPDIR, inifile:
9898
collecting ... collected 8 items
@@ -130,7 +130,7 @@ select tests based on their names::
130130

131131
$ py.test -v -k http # running with the above defined example module
132132
======= test session starts ========
133-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
133+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
134134
cachedir: .cache
135135
rootdir: $REGENDOC_TMPDIR, inifile:
136136
collecting ... collected 4 items
@@ -144,7 +144,7 @@ And you can also run all tests except the ones that match the keyword::
144144

145145
$ py.test -k "not send_http" -v
146146
======= test session starts ========
147-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
147+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
148148
cachedir: .cache
149149
rootdir: $REGENDOC_TMPDIR, inifile:
150150
collecting ... collected 4 items
@@ -160,7 +160,7 @@ Or to select "http" and "quick" tests::
160160

161161
$ py.test -k "http or quick" -v
162162
======= test session starts ========
163-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
163+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
164164
cachedir: .cache
165165
rootdir: $REGENDOC_TMPDIR, inifile:
166166
collecting ... collected 4 items
@@ -201,9 +201,11 @@ You can ask which markers exist for your test suite - the list includes our just
201201
$ py.test --markers
202202
@pytest.mark.webtest: mark a test as a webtest.
203203
204+
@pytest.mark.skip(reason=None): skip the given test function with an optional reason. Example: skip(reason="no way of currently testing this") skips the test.
205+
204206
@pytest.mark.skipif(condition): skip the given test function if eval(condition) results in a True value. Evaluation happens within the module global context. Example: skipif('sys.platform == "win32"') skips the test if we are on the win32 platform. see http://pytest.org/latest/skipping.html
205207
206-
@pytest.mark.xfail(condition, reason=None, run=True, raises=None): mark the the test function as an expected failure if eval(condition) has a True value. Optionally specify a reason for better reporting and run=False if you don't even want to execute the test function. If only specific exception(s) are expected, you can list them in raises, and if the test fails in other ways, it will be reported as a true failure. See http://pytest.org/latest/skipping.html
208+
@pytest.mark.xfail(condition, reason=None, run=True, raises=None, strict=False): mark the the test function as an expected failure if eval(condition) has a True value. Optionally specify a reason for better reporting and run=False if you don't even want to execute the test function. If only specific exception(s) are expected, you can list them in raises, and if the test fails in other ways, it will be reported as a true failure. See http://pytest.org/latest/skipping.html
207209
208210
@pytest.mark.parametrize(argnames, argvalues): call a test function multiple times passing in different arguments in turn. argvalues generally needs to be a list of values if argnames specifies only one name or a list of tuples of values if argnames specifies multiple names. Example: @parametrize('arg1', [1,2]) would lead to two calls of the decorated test function, one with arg1=1 and another with arg1=2.see http://pytest.org/latest/parametrize.html for more info and examples.
209211
@@ -350,7 +352,7 @@ the test needs::
350352

351353
$ py.test -E stage2
352354
======= test session starts ========
353-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
355+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
354356
rootdir: $REGENDOC_TMPDIR, inifile:
355357
collected 1 items
356358
@@ -362,7 +364,7 @@ and here is one that specifies exactly the environment needed::
362364

363365
$ py.test -E stage1
364366
======= test session starts ========
365-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
367+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
366368
rootdir: $REGENDOC_TMPDIR, inifile:
367369
collected 1 items
368370
@@ -375,9 +377,11 @@ The ``--markers`` option always gives you a list of available markers::
375377
$ py.test --markers
376378
@pytest.mark.env(name): mark test to run only on named environment
377379
380+
@pytest.mark.skip(reason=None): skip the given test function with an optional reason. Example: skip(reason="no way of currently testing this") skips the test.
381+
378382
@pytest.mark.skipif(condition): skip the given test function if eval(condition) results in a True value. Evaluation happens within the module global context. Example: skipif('sys.platform == "win32"') skips the test if we are on the win32 platform. see http://pytest.org/latest/skipping.html
379383
380-
@pytest.mark.xfail(condition, reason=None, run=True, raises=None): mark the the test function as an expected failure if eval(condition) has a True value. Optionally specify a reason for better reporting and run=False if you don't even want to execute the test function. If only specific exception(s) are expected, you can list them in raises, and if the test fails in other ways, it will be reported as a true failure. See http://pytest.org/latest/skipping.html
384+
@pytest.mark.xfail(condition, reason=None, run=True, raises=None, strict=False): mark the the test function as an expected failure if eval(condition) has a True value. Optionally specify a reason for better reporting and run=False if you don't even want to execute the test function. If only specific exception(s) are expected, you can list them in raises, and if the test fails in other ways, it will be reported as a true failure. See http://pytest.org/latest/skipping.html
381385
382386
@pytest.mark.parametrize(argnames, argvalues): call a test function multiple times passing in different arguments in turn. argvalues generally needs to be a list of values if argnames specifies only one name or a list of tuples of values if argnames specifies multiple names. Example: @parametrize('arg1', [1,2]) would lead to two calls of the decorated test function, one with arg1=1 and another with arg1=2.see http://pytest.org/latest/parametrize.html for more info and examples.
383387
@@ -481,7 +485,7 @@ then you will see two test skipped and two executed tests as expected::
481485

482486
$ py.test -rs # this option reports skip reasons
483487
======= test session starts ========
484-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
488+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
485489
rootdir: $REGENDOC_TMPDIR, inifile:
486490
collected 4 items
487491
@@ -495,7 +499,7 @@ Note that if you specify a platform via the marker-command line option like this
495499

496500
$ py.test -m linux2
497501
======= test session starts ========
498-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
502+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
499503
rootdir: $REGENDOC_TMPDIR, inifile:
500504
collected 4 items
501505
@@ -547,7 +551,7 @@ We can now use the ``-m option`` to select one set::
547551

548552
$ py.test -m interface --tb=short
549553
======= test session starts ========
550-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
554+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
551555
rootdir: $REGENDOC_TMPDIR, inifile:
552556
collected 4 items
553557
@@ -569,7 +573,7 @@ or to select both "event" and "interface" tests::
569573

570574
$ py.test -m "interface or event" --tb=short
571575
======= test session starts ========
572-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
576+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
573577
rootdir: $REGENDOC_TMPDIR, inifile:
574578
collected 4 items
575579

doc/en/example/nonpython.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ now execute the test specification::
2727

2828
nonpython $ py.test test_simple.yml
2929
======= test session starts ========
30-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
30+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
3131
rootdir: $REGENDOC_TMPDIR/nonpython, inifile:
3232
collected 2 items
3333
34-
test_simple.yml F.
34+
test_simple.yml .F
3535
3636
======= FAILURES ========
3737
_______ usecase: hello ________
@@ -59,13 +59,13 @@ consulted when reporting in ``verbose`` mode::
5959

6060
nonpython $ py.test -v
6161
======= test session starts ========
62-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
62+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
6363
cachedir: .cache
6464
rootdir: $REGENDOC_TMPDIR/nonpython, inifile:
6565
collecting ... collected 2 items
6666
67-
test_simple.yml::hello FAILED
6867
test_simple.yml::ok PASSED
68+
test_simple.yml::hello FAILED
6969
7070
======= FAILURES ========
7171
_______ usecase: hello ________
@@ -81,11 +81,11 @@ interesting to just look at the collection tree::
8181

8282
nonpython $ py.test --collect-only
8383
======= test session starts ========
84-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
84+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
8585
rootdir: $REGENDOC_TMPDIR/nonpython, inifile:
8686
collected 2 items
8787
<YamlFile 'test_simple.yml'>
88-
<YamlItem 'hello'>
8988
<YamlItem 'ok'>
89+
<YamlItem 'hello'>
9090
9191
======= no tests ran in 0.12 seconds ========

doc/en/example/parametrize.rst

+8-11
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ objects, they are still using the default pytest representation::
130130

131131
$ py.test test_time.py --collect-only
132132
======= test session starts ========
133-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
133+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
134134
rootdir: $REGENDOC_TMPDIR, inifile:
135135
collected 6 items
136136
<Module 'test_time.py'>
@@ -181,7 +181,7 @@ this is a fully self-contained example which you can run with::
181181

182182
$ py.test test_scenarios.py
183183
======= test session starts ========
184-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
184+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
185185
rootdir: $REGENDOC_TMPDIR, inifile:
186186
collected 4 items
187187
@@ -194,7 +194,7 @@ If you just collect tests you'll also nicely see 'advanced' and 'basic' as varia
194194

195195
$ py.test --collect-only test_scenarios.py
196196
======= test session starts ========
197-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
197+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
198198
rootdir: $REGENDOC_TMPDIR, inifile:
199199
collected 4 items
200200
<Module 'test_scenarios.py'>
@@ -259,7 +259,7 @@ Let's first see how it looks like at collection time::
259259

260260
$ py.test test_backends.py --collect-only
261261
======= test session starts ========
262-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
262+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
263263
rootdir: $REGENDOC_TMPDIR, inifile:
264264
collected 2 items
265265
<Module 'test_backends.py'>
@@ -320,7 +320,7 @@ The result of this test will be successful::
320320

321321
$ py.test test_indirect_list.py --collect-only
322322
======= test session starts ========
323-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
323+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
324324
rootdir: $REGENDOC_TMPDIR, inifile:
325325
collected 1 items
326326
<Module 'test_indirect_list.py'>
@@ -397,11 +397,8 @@ is to be run with different sets of arguments for its three arguments:
397397
Running it results in some skips if we don't have all the python interpreters installed and otherwise runs all combinations (5 interpreters times 5 interpreters times 3 objects to serialize/deserialize)::
398398

399399
. $ py.test -rs -q multipython.py
400-
ssssssssssss...ssssssssssss
401-
======= short test summary info ========
402-
SKIP [12] $REGENDOC_TMPDIR/CWD/multipython.py:23: 'python3.3' not found
403-
SKIP [12] $REGENDOC_TMPDIR/CWD/multipython.py:23: 'python2.6' not found
404-
3 passed, 24 skipped in 0.12 seconds
400+
...........................
401+
27 passed in 0.12 seconds
405402

406403
Indirect parametrization of optional implementations/imports
407404
--------------------------------------------------------------------
@@ -448,7 +445,7 @@ If you run this with reporting for skips enabled::
448445

449446
$ py.test -rs test_module.py
450447
======= test session starts ========
451-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
448+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
452449
rootdir: $REGENDOC_TMPDIR, inifile:
453450
collected 2 items
454451

doc/en/example/pythoncollection.rst

+7-8
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ then the test collection looks like this::
8282

8383
$ py.test --collect-only
8484
======= test session starts ========
85-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
85+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
8686
rootdir: $REGENDOC_TMPDIR, inifile: setup.cfg
8787
collected 2 items
8888
<Module 'check_myapp.py'>
@@ -128,7 +128,7 @@ You can always peek at the collection tree without running tests like this::
128128

129129
. $ py.test --collect-only pythoncollection.py
130130
======= test session starts ========
131-
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
131+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
132132
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
133133
collected 3 items
134134
<Module 'CWD/pythoncollection.py'>
@@ -180,7 +180,7 @@ and a setup.py dummy file like this::
180180
then a pytest run on Python2 will find the one test and will leave out the
181181
setup.py file::
182182

183-
$ py.test --collect-only
183+
#$ py.test --collect-only
184184
====== test session starts ======
185185
platform linux2 -- Python 2.7.10, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
186186
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
@@ -194,10 +194,9 @@ If you run with a Python3 interpreter both the one test and the setup.py file
194194
will be left out::
195195

196196
$ 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
197+
======= test session starts ========
198+
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
199199
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
200200
collected 0 items
201-
202-
====== no tests ran in 0.03 seconds ======
203-
201+
202+
======= no tests ran in 0.12 seconds ========

0 commit comments

Comments
 (0)