Skip to content

Commit f2a427d

Browse files
authored
Merge pull request pytest-dev#3940 from nicoddemus/release-3.8.0
Release 3.8.0
2 parents 531b76a + 1f20626 commit f2a427d

30 files changed

+391
-93
lines changed

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[run]
22
source = _pytest,testing
33
parallel = 1
4+
branch = 1

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ env/
3838
.ropeproject
3939
.idea
4040
.hypothesis
41+
.pydevproject
42+
.project
43+
.settings

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Endre Galaczi
7373
Eric Hunsberger
7474
Eric Siegerman
7575
Erik M. Bray
76+
Fabio Zadrozny
7677
Feng Ma
7778
Florian Bruhin
7879
Floris Bruynooghe

CHANGELOG.rst

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,90 @@ with advance notice in the **Deprecations** section of releases.
1818
1919
.. towncrier release notes start
2020
21+
pytest 3.8.0 (2018-09-05)
22+
=========================
23+
24+
Deprecations and Removals
25+
-------------------------
26+
27+
- `#2452 <https://github.com/pytest-dev/pytest/issues/2452>`_: ``Config.warn`` has been deprecated, it should be replaced by calls to the standard ``warnings.warn``.
28+
29+
``Node.warn`` now supports two signatures:
30+
31+
* ``node.warn(PytestWarning("some message"))``: is now the recommended way to call this function. The warning
32+
instance must be a ``PytestWarning`` or subclass instance.
33+
34+
* ``node.warn("CI", "some message")``: this code/message form is now deprecated and should be converted to
35+
the warning instance form above.
36+
37+
``RemovedInPytest4Warning`` and ``PytestExperimentalApiWarning`` are now part of the public API and should be accessed
38+
using ``pytest.RemovedInPytest4Warning`` and ``pytest.PytestExperimentalApiWarning``.
39+
40+
41+
- `#3936 <https://github.com/pytest-dev/pytest/issues/3936>`_: ``@pytest.mark.filterwarnings`` second parameter is no longer regex-escaped,
42+
making it possible to actually use regular expressions to check the warning message.
43+
44+
**Note**: regex-escaping the match string was an implementation oversight that might break test suites which depend
45+
on the old behavior.
46+
47+
48+
49+
Features
50+
--------
51+
52+
- `#2452 <https://github.com/pytest-dev/pytest/issues/2452>`_: Internal pytest warnings are now issued using the standard ``warnings`` module, making it possible to use
53+
the standard warnings filters to manage those warnings. This introduces ``PytestWarning``,
54+
``PytestDeprecationWarning`` and ``RemovedInPytest4Warning`` warning types as part of the public API.
55+
56+
Consult `the documentation <https://docs.pytest.org/en/latest/warnings.html#internal-pytest-warnings>`_ for more info.
57+
58+
59+
- `#2908 <https://github.com/pytest-dev/pytest/issues/2908>`_: ``DeprecationWarning`` and ``PendingDeprecationWarning`` are now shown by default if no other warning filter is
60+
configured. This makes pytest more compliant with
61+
`PEP-0506 <https://www.python.org/dev/peps/pep-0565/#recommended-filter-settings-for-test-runners>`_. See
62+
`the docs <https://docs.pytest.org/en/latest/warnings.html#deprecationwarning-and-pendingdeprecationwarning>`_ for
63+
more info.
64+
65+
66+
- `#3784 <https://github.com/pytest-dev/pytest/issues/3784>`_: Add option to disable plugin auto-loading.
67+
68+
69+
- `#3829 <https://github.com/pytest-dev/pytest/issues/3829>`_: Added the ``count`` option to ``console_output_style`` to enable displaying the progress as a count instead of a percentage.
70+
71+
72+
- `#3837 <https://github.com/pytest-dev/pytest/issues/3837>`_: Added support for 'xfailed' and 'xpassed' outcomes to the ``pytester.RunResult.assert_outcomes`` signature.
73+
74+
75+
76+
Bug Fixes
77+
---------
78+
79+
- `#3911 <https://github.com/pytest-dev/pytest/issues/3911>`_: Terminal writer now takes into account unicode character width when writing out progress.
80+
81+
82+
- `#3913 <https://github.com/pytest-dev/pytest/issues/3913>`_: Pytest now returns with correct exit code (EXIT_USAGEERROR, 4) when called with unknown arguments.
83+
84+
85+
- `#3918 <https://github.com/pytest-dev/pytest/issues/3918>`_: Improve performance of assertion rewriting.
86+
87+
88+
89+
Improved Documentation
90+
----------------------
91+
92+
- `#3566 <https://github.com/pytest-dev/pytest/issues/3566>`_: Added a blurb in usage.rst for the usage of -r flag which is used to show an extra test summary info.
93+
94+
95+
- `#3907 <https://github.com/pytest-dev/pytest/issues/3907>`_: Corrected type of the exceptions collection passed to ``xfail``: ``raises`` argument accepts a ``tuple`` instead of ``list``.
96+
97+
98+
99+
Trivial/Internal Changes
100+
------------------------
101+
102+
- `#3853 <https://github.com/pytest-dev/pytest/issues/3853>`_: Removed ``"run all (no recorded failures)"`` message printed with ``--failed-first`` and ``--last-failed`` when there are no failed tests.
103+
104+
21105
pytest 3.7.4 (2018-08-29)
22106
=========================
23107

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ environment:
1515
- TOXENV: "py35"
1616
- TOXENV: "py36"
1717
- TOXENV: "py37"
18-
# - TOXENV: "pypy" reenable when we are able to provide a scandir wheel or build scandir
18+
- TOXENV: "pypy"
1919
- TOXENV: "py27-pexpect"
2020
- TOXENV: "py27-xdist"
2121
- TOXENV: "py27-trial"

changelog/2452.feature.rst

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

changelog/2452.removal.rst

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

changelog/2908.feature.rst

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

changelog/3784.feature.rst

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

changelog/3829.feature.rst

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

changelog/3837.feature.rst

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

changelog/3853.trivial.rst

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

changelog/3907.doc.rst

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

changelog/3913.bugfix.rst

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

changelog/3936.removal.rst

Lines changed: 0 additions & 5 deletions
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.8.0
910
release-3.7.4
1011
release-3.7.3
1112
release-3.7.2

doc/en/announce/release-3.8.0.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
pytest-3.8.0
2+
=======================================
3+
4+
The pytest team is proud to announce the 3.8.0 release!
5+
6+
pytest is a mature Python testing tool with more than a 2000 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+
https://docs.pytest.org/en/latest/changelog.html
13+
14+
For complete documentation, please visit:
15+
16+
https://docs.pytest.org/en/latest/
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+
* Anthony Sottile
25+
* Bruno Oliveira
26+
* CrazyMerlyn
27+
* Daniel Hahler
28+
* Fabio Zadrozny
29+
* Jeffrey Rackauckas
30+
* Ronny Pfannschmidt
31+
* Virgil Dupras
32+
* dhirensr
33+
* hoefling
34+
* wim glenn
35+
36+
37+
Happy testing,
38+
The Pytest Development Team

doc/en/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@
329329

330330

331331
# Example configuration for intersphinx: refer to the Python standard library.
332-
intersphinx_mapping = {"python": ("http://docs.python.org/3", None)}
332+
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
333333

334334

335335
def setup(app):

doc/en/example/reportingdemo.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,9 +613,9 @@ get on the terminal - we are working on that)::
613613

614614
failure_demo.py:261: AssertionError
615615
============================= warnings summary =============================
616-
<undetermined location>
617-
Metafunc.addcall is deprecated and scheduled to be removed in pytest 4.0.
618-
Please use Metafunc.parametrize instead.
616+
$REGENDOC_TMPDIR/assertion/failure_demo.py:24: RemovedInPytest4Warning: Metafunc.addcall is deprecated and scheduled to be removed in pytest 4.0.
617+
Please use Metafunc.parametrize instead.
618+
metafunc.addcall(funcargs=dict(param1=3, param2=6))
619619

620620
-- Docs: https://docs.pytest.org/en/latest/warnings.html
621621
================== 42 failed, 1 warnings in 0.12 seconds ===================

doc/en/talks.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Talks and Tutorials
1414
Books
1515
---------------------------------------------
1616

17+
- `pytest Quick Start Guide, by Bruno Oliveira (2018)
18+
<https://www.packtpub.com/web-development/pytest-quick-start-guide>`_.
19+
1720
- `Python Testing with pytest, by Brian Okken (2017)
1821
<https://pragprog.com/book/bopytest/python-testing-with-pytest>`_.
1922

doc/en/usage.rst

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,49 @@ will be shown (because KeyboardInterrupt is caught by pytest). By using this
140140
option you make sure a trace is shown.
141141

142142

143+
.. _`pytest.detailed_failed_tests_usage`:
144+
145+
Detailed summary report
146+
-----------------------
147+
148+
.. versionadded:: 2.9
149+
150+
The ``-r`` flag can be used to display test results summary at the end of the test session,
151+
making it easy in large test suites to get a clear picture of all failures, skips, xfails, etc.
152+
153+
Example::
154+
155+
$ pytest -ra
156+
=========================== test session starts ============================
157+
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
158+
rootdir: $REGENDOC_TMPDIR, inifile:
159+
collected 0 items
160+
161+
======================= no tests ran in 0.12 seconds =======================
162+
163+
The ``-r`` options accepts a number of characters after it, with ``a`` used above meaning "all except passes".
164+
165+
Here is the full list of available characters that can be used:
166+
167+
- ``f`` - failed
168+
- ``E`` - error
169+
- ``s`` - skipped
170+
- ``x`` - xfailed
171+
- ``X`` - xpassed
172+
- ``p`` - passed
173+
- ``P`` - passed with output
174+
- ``a`` - all except ``pP``
175+
176+
More than one character can be used, so for example to only see failed and skipped tests, you can execute::
177+
178+
$ pytest -rfs
179+
=========================== test session starts ============================
180+
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
181+
rootdir: $REGENDOC_TMPDIR, inifile:
182+
collected 0 items
183+
184+
======================= no tests ran in 0.12 seconds =======================
185+
143186
.. _pdb-option:
144187

145188
Dropping to PDB_ (Python Debugger) on failures

doc/en/warnings.rst

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ Running pytest now produces this output::
2929
test_show_warnings.py . [100%]
3030

3131
============================= warnings summary =============================
32-
test_show_warnings.py::test_one
33-
$REGENDOC_TMPDIR/test_show_warnings.py:4: UserWarning: api v1, should use functions from v2
34-
warnings.warn(UserWarning("api v1, should use functions from v2"))
32+
$REGENDOC_TMPDIR/test_show_warnings.py:4: UserWarning: api v1, should use functions from v2
33+
warnings.warn(UserWarning("api v1, should use functions from v2"))
3534

3635
-- Docs: https://docs.pytest.org/en/latest/warnings.html
3736
=================== 1 passed, 1 warnings in 0.12 seconds ===================
@@ -354,15 +353,13 @@ defines an ``__init__`` constructor, as this prevents the class from being insta
354353
::
355354

356355
$ pytest test_pytest_warnings.py -q
357-
======================================== warnings summary =========================================
358-
test_pytest_warnings.py:1
359-
$REGENDOC_TMPDIR/test_pytest_warnings.py:1: PytestWarning: cannot collect test class 'Test' because it has a __init__ constructor
360-
class Test:
361-
362-
-- Docs: http://doc.pytest.org/en/latest/warnings.html
363-
1 warnings in 0.01 seconds
364356

357+
============================= warnings summary =============================
358+
$REGENDOC_TMPDIR/test_pytest_warnings.py:1: PytestWarning: cannot collect test class 'Test' because it has a __init__ constructor
359+
class Test:
365360

361+
-- Docs: https://docs.pytest.org/en/latest/warnings.html
362+
1 warnings in 0.12 seconds
366363

367364
These warnings might be filtered using the same builtin mechanisms used to filter other types of warnings.
368365

doc/en/writing_plugins.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,8 @@ additionally it is possible to copy examples for a example folder before running
418418
test_example.py .. [100%]
419419
420420
============================= warnings summary =============================
421-
test_example.py::test_plugin
422-
$REGENDOC_TMPDIR/test_example.py:4: PytestExperimentalApiWarning: testdir.copy_example is an experimental api that may change over time
423-
testdir.copy_example("test_example.py")
421+
$REGENDOC_TMPDIR/test_example.py:4: PytestExperimentalApiWarning: testdir.copy_example is an experimental api that may change over time
422+
testdir.copy_example("test_example.py")
424423
425424
-- Docs: https://docs.pytest.org/en/latest/warnings.html
426425
=================== 2 passed, 1 warnings in 0.12 seconds ===================

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def get_environment_marker_support_level():
5959
def main():
6060
extras_require = {}
6161
install_requires = [
62-
"py>=1.5.0",
62+
"py>=1.5.0", # if py gets upgrade to >=1.6, remove _width_of_current_line in terminal.py
6363
"six>=1.10.0",
6464
"setuptools",
6565
"attrs>=17.4.0",

0 commit comments

Comments
 (0)