Skip to content

Commit afdbb6b

Browse files
committed
Merge pull request #1084 from hpk42/branch-281
2.8.1 release
2 parents f61f39e + a007646 commit afdbb6b

22 files changed

+104
-87
lines changed

AUTHORS

+4
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,7 @@ Tom Viner
6464
Trevor Bekolay
6565
Wouter van Ackooy
6666
David Díaz-Barquero
67+
Eric Hunsberger
68+
Simon Gomizelj
69+
Russel Winder
70+
Ben Webb

CHANGELOG

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
2.8.1.dev
2-
---------
1+
2.8.1
2+
-----
3+
4+
- fix #1034: Add missing nodeid on pytest_logwarning call in
5+
addhook. Thanks Simon Gomizelj for the PR.
36

47
- 'deprecated_call' is now only satisfied with a DeprecationWarning or
58
PendingDeprecationWarning. Before 2.8.0, it accepted any warning, and 2.8.0

CONTRIBUTING.rst

+3-9
Original file line numberDiff line numberDiff line change
@@ -209,19 +209,13 @@ but here is a simple overview:
209209
are unsure about either of these steps, submit your pull request and we'll
210210
help you fix it up.
211211

212-
#. Finally, submit a pull request through the GitHub website:
213-
214-
.. image:: doc/en/img/pullrequest.png
215-
:width: 700px
216-
:align: center
217-
218-
::
212+
#. Finally, submit a pull request through the GitHub website using this data::
219213

220214
head-fork: YOUR_GITHUB_USERNAME/pytest
221215
compare: your-branch-name
222216

223217
base-fork: pytest-dev/pytest
224-
base: master # if it's a feature
225-
base: pytest-VERSION # if it's a bugfix
218+
base: master # if it's a bugfix
219+
base: feature # if it's a feature
226220

227221

_pytest/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#
2-
__version__ = '2.8.1.dev1'
2+
__version__ = '2.8.1'

_pytest/pytester.py

+14
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,20 @@ def syspathinsert(self, path=None):
534534
if path is None:
535535
path = self.tmpdir
536536
sys.path.insert(0, str(path))
537+
# a call to syspathinsert() usually means that the caller
538+
# wants to import some dynamically created files.
539+
# with python3 we thus invalidate import caches.
540+
self._possibly_invalidate_import_caches()
541+
542+
def _possibly_invalidate_import_caches(self):
543+
# invalidate caches if we can (py33 and above)
544+
try:
545+
import importlib
546+
except ImportError:
547+
pass
548+
else:
549+
if hasattr(importlib, "invalidate_caches"):
550+
importlib.invalidate_caches()
537551

538552
def mkdir(self, name):
539553
"""Create a new (sub)directory."""

doc/en/assert.rst

+2-2
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.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
29+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1
3030
rootdir: $REGENDOC_TMPDIR, inifile:
3131
collected 1 items
3232
@@ -146,7 +146,7 @@ if you run this module::
146146

147147
$ py.test test_assert2.py
148148
======= test session starts ========
149-
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
149+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1
150150
rootdir: $REGENDOC_TMPDIR, inifile:
151151
collected 1 items
152152

doc/en/cache.rst

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

7474
$ py.test --lf
7575
======= test session starts ========
76-
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
76+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1
7777
run-last-failure: rerun last 2 failures
7878
rootdir: $REGENDOC_TMPDIR, inifile:
7979
collected 50 items
@@ -114,7 +114,7 @@ of ``FF`` and dots)::
114114

115115
$ py.test --ff
116116
======= test session starts ========
117-
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
117+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1
118118
run-last-failure: rerun last 2 failures first
119119
rootdir: $REGENDOC_TMPDIR, inifile:
120120
collected 50 items
@@ -219,7 +219,7 @@ You can always peek at the content of the cache using the
219219

220220
$ py.test --cache-clear
221221
======= test session starts ========
222-
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
222+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1
223223
rootdir: $REGENDOC_TMPDIR, inifile:
224224
collected 1 items
225225

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.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
67+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1
6868
rootdir: $REGENDOC_TMPDIR, inifile:
6969
collected 2 items
7070

doc/en/contents.rst

+10-5
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,16 @@ Full pytest documentation
1818
contributing
1919
plugins_index/index
2020
talks
21-
funcarg_compare
22-
announce/index
2321

24-
.. toctree::
25-
:hidden:
22+
.. only:: html
23+
.. toctree::
24+
25+
funcarg_compare
26+
announce/index
27+
28+
.. only:: html
29+
.. toctree::
30+
:hidden:
2631

27-
changelog
32+
changelog
2833

doc/en/doctest.rst

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

4747
$ py.test
4848
======= test session starts ========
49-
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
49+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1
5050
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
5151
collected 1 items
5252

doc/en/example/markers.rst

+14-14
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.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
34+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
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.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
48+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
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.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
69+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
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.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
82+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
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.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
95+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
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.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
133+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
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.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
147+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
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.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
163+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
164164
cachedir: .cache
165165
rootdir: $REGENDOC_TMPDIR, inifile:
166166
collecting ... collected 4 items
@@ -350,7 +350,7 @@ the test needs::
350350

351351
$ py.test -E stage2
352352
======= test session starts ========
353-
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
353+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1
354354
rootdir: $REGENDOC_TMPDIR, inifile:
355355
collected 1 items
356356
@@ -362,7 +362,7 @@ and here is one that specifies exactly the environment needed::
362362

363363
$ py.test -E stage1
364364
======= test session starts ========
365-
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
365+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1
366366
rootdir: $REGENDOC_TMPDIR, inifile:
367367
collected 1 items
368368
@@ -481,7 +481,7 @@ then you will see two test skipped and two executed tests as expected::
481481

482482
$ py.test -rs # this option reports skip reasons
483483
======= test session starts ========
484-
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
484+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1
485485
rootdir: $REGENDOC_TMPDIR, inifile:
486486
collected 4 items
487487
@@ -495,7 +495,7 @@ Note that if you specify a platform via the marker-command line option like this
495495

496496
$ py.test -m linux2
497497
======= test session starts ========
498-
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
498+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1
499499
rootdir: $REGENDOC_TMPDIR, inifile:
500500
collected 4 items
501501
@@ -547,7 +547,7 @@ We can now use the ``-m option`` to select one set::
547547

548548
$ py.test -m interface --tb=short
549549
======= test session starts ========
550-
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
550+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1
551551
rootdir: $REGENDOC_TMPDIR, inifile:
552552
collected 4 items
553553
@@ -569,7 +569,7 @@ or to select both "event" and "interface" tests::
569569

570570
$ py.test -m "interface or event" --tb=short
571571
======= test session starts ========
572-
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
572+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1
573573
rootdir: $REGENDOC_TMPDIR, inifile:
574574
collected 4 items
575575

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.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
30+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, 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.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
62+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.4
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 $ py.test --collect-only
8383
======= test session starts ========
84-
platform linux -- Python 3.4.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
84+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, 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
======= in 0.12 seconds ========

doc/en/example/parametrize.rst

+9-12
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.3, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
133+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, 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.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
184+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, 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.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
197+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, 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.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
262+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, 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.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
323+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1
324324
rootdir: $REGENDOC_TMPDIR, inifile:
325325
collected 1 items
326326
<Module 'test_indirect_list.py'>
@@ -369,7 +369,7 @@ argument sets to use for each test function. Let's run it::
369369
$ py.test -q
370370
F..
371371
======= FAILURES ========
372-
_______ TestClass.test_equals[1-2] ________
372+
_______ TestClass.test_equals[2-1] ________
373373
374374
self = <test_parametrize.TestClass object at 0xdeadbeef>, a = 1, b = 2
375375
@@ -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:22: 'python3.3' not found
403-
SKIP [12] $REGENDOC_TMPDIR/CWD/multipython.py:22: '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.2, pytest-2.8.1.dev1, py-1.4.30, pluggy-0.3.1
448+
platform linux -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1
452449
rootdir: $REGENDOC_TMPDIR, inifile:
453450
collected 2 items
454451

0 commit comments

Comments
 (0)