Skip to content

Commit dc9a9ec

Browse files
authored
Merge pull request #3162 from nicoddemus/release-3.4.0
Release 3.4.0
2 parents 71a7b3c + 527845e commit dc9a9ec

40 files changed

+240
-75
lines changed

CHANGELOG.rst

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,138 @@
88
99
.. towncrier release notes start
1010
11+
Pytest 3.4.0 (2018-01-30)
12+
=========================
13+
14+
Deprecations and Removals
15+
-------------------------
16+
17+
- All pytest classes now subclass ``object`` for better Python 2/3 compatibility.
18+
This should not affect user code except in very rare edge cases. (`#2147
19+
<https://github.com/pytest-dev/pytest/issues/2147>`_)
20+
21+
22+
Features
23+
--------
24+
25+
- Introduce ``empty_parameter_set_mark`` ini option to select which mark to
26+
apply when ``@pytest.mark.parametrize`` is given an empty set of parameters.
27+
Valid options are ``skip`` (default) and ``xfail``. Note that it is planned
28+
to change the default to ``xfail`` in future releases as this is considered
29+
less error prone. (`#2527
30+
<https://github.com/pytest-dev/pytest/issues/2527>`_)
31+
32+
- **Incompatible change**: after community feedback the `logging
33+
<https://docs.pytest.org/en/latest/logging.html>`_ functionality has
34+
undergone some changes. Please consult the `logging documentation
35+
<https://docs.pytest.org/en/latest/logging.html#incompatible-changes-in-pytest-3-4>`_
36+
for details. (`#3013 <https://github.com/pytest-dev/pytest/issues/3013>`_)
37+
38+
- Console output falls back to "classic" mode when capturing is disabled (``-s``),
39+
otherwise the output gets garbled to the point of being useless. (`#3038
40+
<https://github.com/pytest-dev/pytest/issues/3038>`_)
41+
42+
- New `pytest_runtest_logfinish
43+
<https://docs.pytest.org/en/latest/writing_plugins.html#_pytest.hookspec.pytest_runtest_logfinish>`_
44+
hook which is called when a test item has finished executing, analogous to
45+
`pytest_runtest_logstart
46+
<https://docs.pytest.org/en/latest/writing_plugins.html#_pytest.hookspec.pytest_runtest_start>`_.
47+
(`#3101 <https://github.com/pytest-dev/pytest/issues/3101>`_)
48+
49+
- Improve performance when collecting tests using many fixtures. (`#3107
50+
<https://github.com/pytest-dev/pytest/issues/3107>`_)
51+
52+
- New ``caplog.get_records(when)`` method which provides access to the captured
53+
records for the ``"setup"``, ``"call"`` and ``"teardown"``
54+
testing stages. (`#3117 <https://github.com/pytest-dev/pytest/issues/3117>`_)
55+
56+
- New fixture ``record_xml_attribute`` that allows modifying and inserting
57+
attributes on the ``<testcase>`` xml node in JUnit reports. (`#3130
58+
<https://github.com/pytest-dev/pytest/issues/3130>`_)
59+
60+
- The default cache directory has been renamed from ``.cache`` to
61+
``.pytest_cache`` after community feedback that the name ``.cache`` did not
62+
make it clear that it was used by pytest. (`#3138
63+
<https://github.com/pytest-dev/pytest/issues/3138>`_)
64+
65+
- Colorize the levelname column in the live-log output. (`#3142
66+
<https://github.com/pytest-dev/pytest/issues/3142>`_)
67+
68+
69+
Bug Fixes
70+
---------
71+
72+
- Fix hanging pexpect test on MacOS by using flush() instead of wait().
73+
(`#2022 <https://github.com/pytest-dev/pytest/issues/2022>`_)
74+
75+
- Fix restoring Python state after in-process pytest runs with the
76+
``pytester`` plugin; this may break tests using multiple inprocess
77+
pytest runs if later ones depend on earlier ones leaking global interpreter
78+
changes. (`#3016 <https://github.com/pytest-dev/pytest/issues/3016>`_)
79+
80+
- Fix skipping plugin reporting hook when test aborted before plugin setup
81+
hook. (`#3074 <https://github.com/pytest-dev/pytest/issues/3074>`_)
82+
83+
- Fix progress percentage reported when tests fail during teardown. (`#3088
84+
<https://github.com/pytest-dev/pytest/issues/3088>`_)
85+
86+
- **Incompatible change**: ``-o/--override`` option no longer eats all the
87+
remaining options, which can lead to surprising behavior: for example,
88+
``pytest -o foo=1 /path/to/test.py`` would fail because ``/path/to/test.py``
89+
would be considered as part of the ``-o`` command-line argument. One
90+
consequence of this is that now multiple configuration overrides need
91+
multiple ``-o`` flags: ``pytest -o foo=1 -o bar=2``. (`#3103
92+
<https://github.com/pytest-dev/pytest/issues/3103>`_)
93+
94+
95+
Improved Documentation
96+
----------------------
97+
98+
- Document hooks (defined with ``historic=True``) which cannot be used with
99+
``hookwrapper=True``. (`#2423
100+
<https://github.com/pytest-dev/pytest/issues/2423>`_)
101+
102+
- Clarify that warning capturing doesn't change the warning filter by default.
103+
(`#2457 <https://github.com/pytest-dev/pytest/issues/2457>`_)
104+
105+
- Clarify a possible confusion when using pytest_fixture_setup with fixture
106+
functions that return None. (`#2698
107+
<https://github.com/pytest-dev/pytest/issues/2698>`_)
108+
109+
- Fix the wording of a sentence on doctest flags used in pytest. (`#3076
110+
<https://github.com/pytest-dev/pytest/issues/3076>`_)
111+
112+
- Prefer ``https://*.readthedocs.io`` over ``http://*.rtfd.org`` for links in
113+
the documentation. (`#3092
114+
<https://github.com/pytest-dev/pytest/issues/3092>`_)
115+
116+
- Improve readability (wording, grammar) of Getting Started guide (`#3131
117+
<https://github.com/pytest-dev/pytest/issues/3131>`_)
118+
119+
- Added note that calling pytest.main multiple times from the same process is
120+
not recommended because of import caching. (`#3143
121+
<https://github.com/pytest-dev/pytest/issues/3143>`_)
122+
123+
124+
Trivial/Internal Changes
125+
------------------------
126+
127+
- Show a simple and easy error when keyword expressions trigger a syntax error
128+
(for example, ``"-k foo and import"`` will show an error that you can not use
129+
the ``import`` keyword in expressions). (`#2953
130+
<https://github.com/pytest-dev/pytest/issues/2953>`_)
131+
132+
- Change parametrized automatic test id generation to use the ``__name__``
133+
attribute of functions instead of the fallback argument name plus counter.
134+
(`#2976 <https://github.com/pytest-dev/pytest/issues/2976>`_)
135+
136+
- Replace py.std with stdlib imports. (`#3067
137+
<https://github.com/pytest-dev/pytest/issues/3067>`_)
138+
139+
- Corrected 'you' to 'your' in logging docs. (`#3129
140+
<https://github.com/pytest-dev/pytest/issues/3129>`_)
141+
142+
11143
Pytest 3.3.2 (2017-12-25)
12144
=========================
13145

HOWTORELEASE.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ taking a lot of time to make a new one.
1212

1313
#. Install development dependencies in a virtual environment with::
1414

15-
pip3 install -r tasks/requirements.txt
15+
pip3 install -U -r tasks/requirements.txt
1616

1717
#. Create a branch ``release-X.Y.Z`` with the version for the release.
1818

changelog/2022.bugfix

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/2147.removal

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/2423.doc

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/2457.doc

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/2527.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/2698.doc

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/2953.trivial

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/2976.trivial

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3013.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3016.bugfix

Lines changed: 0 additions & 2 deletions
This file was deleted.

changelog/3038.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3067.trivial

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3074.bugfix

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3076.doc

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3088.bugfix

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3092.doc

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3101.feature

Lines changed: 0 additions & 3 deletions
This file was deleted.

changelog/3103.bugfix

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3107.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3117.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3129.trivial

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3130.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3131.doc

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3138.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3142.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3143.doc

Lines changed: 0 additions & 1 deletion
This file was deleted.

doc/en/announce/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Release announcements
66
:maxdepth: 2
77

88

9+
release-3.4.0
910
release-3.3.2
1011
release-3.3.1
1112
release-3.3.0

doc/en/announce/release-3.4.0.rst

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
pytest-3.4.0
2+
=======================================
3+
4+
The pytest team is proud to announce the 3.4.0 release!
5+
6+
pytest is a mature Python testing tool with more than a 1600 tests
7+
against itself, passing on many different interpreters and platforms.
8+
9+
This release contains a number of bugs fixes and improvements, so users are encouraged
10+
to take a look at the CHANGELOG:
11+
12+
http://doc.pytest.org/en/latest/changelog.html
13+
14+
For complete documentation, please visit:
15+
16+
http://docs.pytest.org
17+
18+
As usual, you can upgrade from pypi via:
19+
20+
pip install -U pytest
21+
22+
Thanks to all who contributed to this release, among them:
23+
24+
* Aaron
25+
* Alan Velasco
26+
* Anders Hovmöller
27+
* Andrew Toolan
28+
* Anthony Sottile
29+
* Aron Coyle
30+
* Brian Maissy
31+
* Bruno Oliveira
32+
* Cyrus Maden
33+
* Florian Bruhin
34+
* Henk-Jaap Wagenaar
35+
* Ian Lesperance
36+
* Jon Dufresne
37+
* Jurko Gospodnetić
38+
* Kate
39+
* Kimberly
40+
* Per A. Brodtkorb
41+
* Pierre-Alexandre Fonta
42+
* Raphael Castaneda
43+
* Ronny Pfannschmidt
44+
* ST John
45+
* Segev Finer
46+
* Thomas Hisch
47+
* Tzu-ping Chung
48+
* feuillemorte
49+
50+
51+
Happy testing,
52+
The Pytest Development Team

doc/en/builtin.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ You can ask for available builtin or project-custom
116116
Add extra xml properties to the tag for the calling test.
117117
The fixture is callable with ``(name, value)``, with value being automatically
118118
xml-encoded.
119+
record_xml_attribute
120+
Add extra xml attributes to the tag for the calling test.
121+
The fixture is callable with ``(name, value)``, with value being automatically
122+
xml-encoded
119123
caplog
120124
Access and control log capturing.
121125

doc/en/cache.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ You can always peek at the content of the cache using the
225225
=========================== test session starts ============================
226226
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
227227
rootdir: $REGENDOC_TMPDIR, inifile:
228-
cachedir: $REGENDOC_TMPDIR/.cache
228+
cachedir: $REGENDOC_TMPDIR/.pytest_cache
229229
------------------------------- cache values -------------------------------
230230
cache/lastfailed contains:
231231
{'test_caching.py::test_function': True}

doc/en/example/assertion/failure_demo.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ def func1(self):
157157

158158
# thanks to Matthew Scott for this test
159159
def test_dynamic_compile_shows_nicely():
160+
import imp
161+
import sys
160162
src = 'def foo():\n assert 1 == 0\n'
161163
name = 'abc-123'
162164
module = imp.new_module(name)

doc/en/example/markers.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ You can then restrict a test run to only run tests marked with ``webtest``::
3232
$ pytest -v -m webtest
3333
=========================== test session starts ============================
3434
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
35-
cachedir: .cache
35+
cachedir: .pytest_cache
3636
rootdir: $REGENDOC_TMPDIR, inifile:
3737
collecting ... collected 4 items
3838
@@ -46,7 +46,7 @@ Or the inverse, running all tests except the webtest ones::
4646
$ pytest -v -m "not webtest"
4747
=========================== test session starts ============================
4848
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
49-
cachedir: .cache
49+
cachedir: .pytest_cache
5050
rootdir: $REGENDOC_TMPDIR, inifile:
5151
collecting ... collected 4 items
5252
@@ -67,7 +67,7 @@ tests based on their module, class, method, or function name::
6767
$ pytest -v test_server.py::TestClass::test_method
6868
=========================== test session starts ============================
6969
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
70-
cachedir: .cache
70+
cachedir: .pytest_cache
7171
rootdir: $REGENDOC_TMPDIR, inifile:
7272
collecting ... collected 1 item
7373
@@ -80,7 +80,7 @@ You can also select on the class::
8080
$ pytest -v test_server.py::TestClass
8181
=========================== test session starts ============================
8282
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
83-
cachedir: .cache
83+
cachedir: .pytest_cache
8484
rootdir: $REGENDOC_TMPDIR, inifile:
8585
collecting ... collected 1 item
8686
@@ -93,7 +93,7 @@ Or select multiple nodes::
9393
$ pytest -v test_server.py::TestClass test_server.py::test_send_http
9494
=========================== test session starts ============================
9595
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
96-
cachedir: .cache
96+
cachedir: .pytest_cache
9797
rootdir: $REGENDOC_TMPDIR, inifile:
9898
collecting ... collected 2 items
9999
@@ -131,7 +131,7 @@ select tests based on their names::
131131
$ pytest -v -k http # running with the above defined example module
132132
=========================== test session starts ============================
133133
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
134-
cachedir: .cache
134+
cachedir: .pytest_cache
135135
rootdir: $REGENDOC_TMPDIR, inifile:
136136
collecting ... collected 4 items
137137
@@ -145,7 +145,7 @@ And you can also run all tests except the ones that match the keyword::
145145
$ pytest -k "not send_http" -v
146146
=========================== test session starts ============================
147147
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
148-
cachedir: .cache
148+
cachedir: .pytest_cache
149149
rootdir: $REGENDOC_TMPDIR, inifile:
150150
collecting ... collected 4 items
151151
@@ -161,7 +161,7 @@ Or to select "http" and "quick" tests::
161161
$ pytest -k "http or quick" -v
162162
=========================== test session starts ============================
163163
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
164-
cachedir: .cache
164+
cachedir: .pytest_cache
165165
rootdir: $REGENDOC_TMPDIR, inifile:
166166
collecting ... collected 4 items
167167
@@ -432,7 +432,7 @@ The output is as follows::
432432

433433
$ pytest -q -s
434434
Marker info name=my_marker args=(<function hello_world at 0xdeadbeef>,) kwars={}
435-
. [100%]
435+
.
436436
1 passed in 0.12 seconds
437437

438438
We can see that the custom marker has its argument set extended with the function ``hello_world``. This is the key difference between creating a custom marker as a callable, which invokes ``__call__`` behind the scenes, and using ``with_args``.
@@ -477,7 +477,7 @@ Let's run this without capturing output and see what we get::
477477
glob args=('function',) kwargs={'x': 3}
478478
glob args=('class',) kwargs={'x': 2}
479479
glob args=('module',) kwargs={'x': 1}
480-
. [100%]
480+
.
481481
1 passed in 0.12 seconds
482482

483483
marking platform specific tests with pytest

doc/en/example/nonpython.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ consulted when reporting in ``verbose`` mode::
6060
nonpython $ pytest -v
6161
=========================== test session starts ============================
6262
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.5
63-
cachedir: .cache
63+
cachedir: .pytest_cache
6464
rootdir: $REGENDOC_TMPDIR/nonpython, inifile:
6565
collecting ... collected 2 items
6666

0 commit comments

Comments
 (0)