Skip to content

Commit 9540106

Browse files
authored
Merge pull request #1780 from nicoddemus/regen-pytest30
Run regen-docs for pytest 3.0
2 parents 3cd2e37 + 21a90c8 commit 9540106

19 files changed

+117
-111
lines changed

doc/en/assert.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ you will see the return value of the function call::
2626

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

171171
$ pytest test_assert2.py
172172
======= test session starts ========
173-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
173+
platform linux -- Python 3.5.2, pytest-3.0.0, py-1.4.31, pluggy-0.3.1
174174
rootdir: $REGENDOC_TMPDIR, inifile:
175175
collected 1 items
176176
@@ -246,8 +246,7 @@ the conftest file::
246246
f1 = Foo(1)
247247
f2 = Foo(2)
248248
> assert f1 == f2
249-
E assert Comparing Foo instances:
250-
E vals: 1 != 2
249+
E AssertionError
251250
252251
test_foocompare.py:11: AssertionError
253252
1 failed in 0.12 seconds

doc/en/builtin.rst

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,23 @@ You can ask for available builtin or project-custom
8989
9090
Values can be any object handled by the json stdlib module.
9191
capsys
92-
enables capturing of writes to sys.stdout/sys.stderr and makes
92+
Enable capturing of writes to sys.stdout/sys.stderr and make
9393
captured output available via ``capsys.readouterr()`` method calls
9494
which return a ``(out, err)`` tuple.
9595
capfd
96-
enables capturing of writes to file descriptors 1 and 2 and makes
96+
Enable capturing of writes to file descriptors 1 and 2 and make
9797
captured output available via ``capfd.readouterr()`` method calls
9898
which return a ``(out, err)`` tuple.
99+
doctest_namespace
100+
Inject names into the doctest namespace.
101+
pytestconfig
102+
the pytest config object with access to command line opts.
99103
record_xml_property
100-
Fixture that adds extra xml properties to the tag for the calling test.
101-
The fixture is callable with (name, value), with value being automatically
104+
Add extra xml properties to the tag for the calling test.
105+
The fixture is callable with ``(name, value)``, with value being automatically
102106
xml-encoded.
103107
monkeypatch
104-
The returned ``monkeypatch`` funcarg provides these
108+
The returned ``monkeypatch`` fixture provides these
105109
helper methods to modify objects, dictionaries or os.environ::
106110
107111
monkeypatch.setattr(obj, name, value, raising=True)
@@ -114,11 +118,11 @@ You can ask for available builtin or project-custom
114118
monkeypatch.chdir(path)
115119
116120
All modifications will be undone after the requesting
117-
test function has finished. The ``raising``
121+
test function or fixture has finished. The ``raising``
118122
parameter determines if a KeyError or AttributeError
119123
will be raised if the set/deletion operation has no target.
120-
pytestconfig
121-
the pytest config object with access to command line opts.
124+
125+
This fixture is ``invocation``-scoped.
122126
recwarn
123127
Return a WarningsRecorder instance that provides these methods:
124128
@@ -130,7 +134,7 @@ You can ask for available builtin or project-custom
130134
tmpdir_factory
131135
Return a TempdirFactory instance for the test session.
132136
tmpdir
133-
return a temporary directory path object
137+
Return a temporary directory path object
134138
which is unique to each test function invocation,
135139
created as a sub directory of the base temporary
136140
directory. The returned object is a `py.path.local`_

doc/en/cache.rst

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ If you then run it with ``--lf``::
8080

8181
$ pytest --lf
8282
======= test session starts ========
83-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
83+
platform linux -- Python 3.5.2, pytest-3.0.0, 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
$ pytest --ff
123123
======= test session starts ========
124-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
124+
platform linux -- Python 3.5.2, pytest-3.0.0, 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,23 +226,16 @@ You can always peek at the content of the cache using the
226226

227227
$ py.test --cache-show
228228
======= test session starts ========
229-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
229+
platform linux -- Python 3.5.2, pytest-3.0.0, py-1.4.31, pluggy-0.3.1
230230
rootdir: $REGENDOC_TMPDIR, inifile:
231-
collected 1 items
232-
233-
test_caching.py F
234-
235-
======= FAILURES ========
236-
_______ test_function ________
237-
238-
mydata = 42
239-
240-
def test_function(mydata):
241-
> assert mydata == 23
242-
E assert 42 == 23
243-
244-
test_caching.py:14: AssertionError
245-
======= 1 failed in 0.12 seconds ========
231+
cachedir: $REGENDOC_TMPDIR/.cache
232+
------------------------------- cache values -------------------------------
233+
cache/lastfailed contains:
234+
{'test_caching.py::test_function': True}
235+
example/value contains:
236+
42
237+
238+
======= no tests ran in 0.12 seconds ========
246239

247240
Clearing Cache content
248241
-------------------------------

doc/en/capture.rst

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

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

doc/en/doctest.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ then you can just invoke ``pytest`` without command line options::
4848

4949
$ pytest
5050
======= test session starts ========
51-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
51+
platform linux -- Python 3.5.2, pytest-3.0.0, py-1.4.31, pluggy-0.3.1
5252
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
5353
collected 1 items
5454

doc/en/example/markers.rst

Lines changed: 14 additions & 14 deletions
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
$ pytest -v -m webtest
3333
======= test session starts ========
34-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
34+
platform linux -- Python 3.5.2, pytest-3.0.0, 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
$ pytest -v -m "not webtest"
4747
======= test session starts ========
48-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
48+
platform linux -- Python 3.5.2, pytest-3.0.0, 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
$ pytest -v test_server.py::TestClass::test_method
6868
======= test session starts ========
69-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
69+
platform linux -- Python 3.5.2, pytest-3.0.0, 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
$ pytest -v test_server.py::TestClass
8181
======= test session starts ========
82-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
82+
platform linux -- Python 3.5.2, pytest-3.0.0, 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
$ pytest -v test_server.py::TestClass test_server.py::test_send_http
9494
======= test session starts ========
95-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
95+
platform linux -- Python 3.5.2, pytest-3.0.0, 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
$ pytest -v -k http # running with the above defined example module
132132
======= test session starts ========
133-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
133+
platform linux -- Python 3.5.2, pytest-3.0.0, 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
$ pytest -k "not send_http" -v
146146
======= test session starts ========
147-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
147+
platform linux -- Python 3.5.2, pytest-3.0.0, 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
$ pytest -k "http or quick" -v
162162
======= test session starts ========
163-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
163+
platform linux -- Python 3.5.2, pytest-3.0.0, 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
@@ -352,7 +352,7 @@ the test needs::
352352

353353
$ pytest -E stage2
354354
======= test session starts ========
355-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
355+
platform linux -- Python 3.5.2, pytest-3.0.0, py-1.4.31, pluggy-0.3.1
356356
rootdir: $REGENDOC_TMPDIR, inifile:
357357
collected 1 items
358358
@@ -364,7 +364,7 @@ and here is one that specifies exactly the environment needed::
364364

365365
$ pytest -E stage1
366366
======= test session starts ========
367-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
367+
platform linux -- Python 3.5.2, pytest-3.0.0, py-1.4.31, pluggy-0.3.1
368368
rootdir: $REGENDOC_TMPDIR, inifile:
369369
collected 1 items
370370
@@ -485,7 +485,7 @@ then you will see two test skipped and two executed tests as expected::
485485

486486
$ pytest -rs # this option reports skip reasons
487487
======= test session starts ========
488-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
488+
platform linux -- Python 3.5.2, pytest-3.0.0, py-1.4.31, pluggy-0.3.1
489489
rootdir: $REGENDOC_TMPDIR, inifile:
490490
collected 4 items
491491
@@ -499,7 +499,7 @@ Note that if you specify a platform via the marker-command line option like this
499499

500500
$ pytest -m linux2
501501
======= test session starts ========
502-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
502+
platform linux -- Python 3.5.2, pytest-3.0.0, py-1.4.31, pluggy-0.3.1
503503
rootdir: $REGENDOC_TMPDIR, inifile:
504504
collected 4 items
505505
@@ -551,7 +551,7 @@ We can now use the ``-m option`` to select one set::
551551

552552
$ pytest -m interface --tb=short
553553
======= test session starts ========
554-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
554+
platform linux -- Python 3.5.2, pytest-3.0.0, py-1.4.31, pluggy-0.3.1
555555
rootdir: $REGENDOC_TMPDIR, inifile:
556556
collected 4 items
557557
@@ -573,7 +573,7 @@ or to select both "event" and "interface" tests::
573573

574574
$ pytest -m "interface or event" --tb=short
575575
======= test session starts ========
576-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
576+
platform linux -- Python 3.5.2, pytest-3.0.0, py-1.4.31, pluggy-0.3.1
577577
rootdir: $REGENDOC_TMPDIR, inifile:
578578
collected 4 items
579579

doc/en/example/nonpython.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ now execute the test specification::
2727

2828
nonpython $ pytest test_simple.yml
2929
======= test session starts ========
30-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
30+
platform linux -- Python 3.5.2, pytest-3.0.0, 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 $ pytest -v
6161
======= test session starts ========
62-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
62+
platform linux -- Python 3.5.2, pytest-3.0.0, 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::ok PASSED
6867
test_simple.yml::hello FAILED
68+
test_simple.yml::ok PASSED
6969
7070
======= FAILURES ========
7171
_______ usecase: hello ________
@@ -81,11 +81,11 @@ interesting to just look at the collection tree::
8181

8282
nonpython $ pytest --collect-only
8383
======= test session starts ========
84-
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
84+
platform linux -- Python 3.5.2, pytest-3.0.0, 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 'ok'>
8988
<YamlItem 'hello'>
89+
<YamlItem 'ok'>
9090
9191
======= no tests ran in 0.12 seconds ========

doc/en/example/nonpython/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class YamlFile(pytest.File):
1010
def collect(self):
1111
import yaml # we need a yaml parser, e.g. PyYAML
1212
raw = yaml.safe_load(self.fspath.open())
13-
for name, spec in raw.items():
13+
for name, spec in sorted(raw.items()):
1414
yield YamlItem(name, self, spec)
1515

1616
class YamlItem(pytest.Item):
@@ -19,7 +19,7 @@ def __init__(self, name, parent, spec):
1919
self.spec = spec
2020

2121
def runtest(self):
22-
for name, value in self.spec.items():
22+
for name, value in sorted(self.spec.items()):
2323
# some custom test execution (dumb example follows)
2424
if name != value:
2525
raise YamlException(self, name, value)

0 commit comments

Comments
 (0)