Skip to content

Commit 8ccc017

Browse files
authored
Release 5.1.0 (#5748)
Release 5.1.0
2 parents ac3056c + eaf7ce9 commit 8ccc017

File tree

99 files changed

+2054
-1272
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2054
-1272
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Here is a quick checklist that should be present in PRs.
66
-->
77

88
- [ ] Target the `master` branch for bug fixes, documentation updates and trivial changes.
9-
- [ ] Target the `features` branch for new features and removals/deprecations.
9+
- [ ] Target the `features` branch for new features, improvements, and removals/deprecations.
1010
- [ ] Include documentation when adding new features.
1111
- [ ] Include new tests or update existing tests when applicable.
1212

.pre-commit-config.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,10 @@ repos:
4242
hooks:
4343
- id: rst-backticks
4444
- repo: https://github.com/pre-commit/mirrors-mypy
45-
rev: v0.711
45+
rev: v0.720
4646
hooks:
4747
- id: mypy
48-
name: mypy (src)
49-
files: ^src/
50-
args: []
51-
- id: mypy
52-
name: mypy (testing)
53-
files: ^testing/
48+
files: ^(src/|testing/)
5449
args: []
5550
- repo: local
5651
hooks:
@@ -64,7 +59,7 @@ repos:
6459
name: changelog filenames
6560
language: fail
6661
entry: 'changelog files must be named ####.(feature|bugfix|doc|deprecation|removal|vendor|trivial).rst'
67-
exclude: changelog/(\d+\.(feature|bugfix|doc|deprecation|removal|vendor|trivial).rst|README.rst|_template.rst)
62+
exclude: changelog/(\d+\.(feature|improvement|bugfix|doc|deprecation|removal|vendor|trivial).rst|README.rst|_template.rst)
6863
files: ^changelog/
6964
- id: py-deprecated
7065
name: py library is deprecated

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,17 @@ jobs:
7272

7373
- stage: deploy
7474
python: '3.6'
75-
install: pip install -U setuptools setuptools_scm
75+
install: pip install -U setuptools setuptools_scm tox
7676
script: skip
77+
# token to upload github release notes: GH_RELEASE_NOTES_TOKEN
78+
env:
79+
- secure: "OjOeL7/0JUDkV00SsTs732e8vQjHynpbG9FKTNtZZJ+1Zn4Cib+hAlwmlBnvVukML0X60YpcfjnC4quDOIGLPsh5zeXnvJmYtAIIUNQXjWz8NhcGYrhyzuP1rqV22U68RTCdmOq3lMYU/W2acwHP7T49PwJtOiUM5kF120UAQ0Zi5EmkqkIvH8oM5mO9Dlver+/U7Htpz9rhKrHBXQNCMZI6yj2aUyukqB2PN2fjAlDbCF//+FmvYw9NjT4GeFOSkTCf4ER9yfqs7yglRfwiLtOCZ2qKQhWZNsSJDB89rxIRXWavJUjJKeY2EW2/NkomYJDpqJLIF4JeFRw/HhA47CYPeo6BJqyyNV+0CovL1frpWfi9UQw2cMbgFUkUIUk3F6DD59PHNIOX2R/HX56dQsw7WKl3QuHlCOkICXYg8F7Ta684IoKjeTX03/6QNOkURfDBwfGszY0FpbxrjCSWKom6RyZdyidnESaxv9RzjcIRZVh1rp8KMrwS1OrwRSdG0zjlsPr49hWMenN/8fKgcHTV4/r1Tj6mip0dorSRCrgUNIeRBKgmui6FS8642ab5JNKOxMteVPVR2sFuhjOQ0Jy+PmvceYY9ZMWc3+/B/KVh0dZ3hwvLGZep/vxDS2PwCA5/xw31714vT5LxidKo8yECjBynMU/wUTTS695D3NY="
80+
addons:
81+
apt:
82+
packages:
83+
# required by publish_gh_release_notes
84+
- pandoc
85+
after_deploy: tox -e publish_gh_release_notes
7786
deploy:
7887
provider: pypi
7988
user: nicoddemus

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ Danielle Jenkins
7171
Dave Hunt
7272
David Díaz-Barquero
7373
David Mohr
74+
David Paul Röthlisberger
7475
David Szotten
7576
David Vierra
7677
Daw-Ran Liou

CHANGELOG.rst

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,164 @@ with advance notice in the **Deprecations** section of releases.
1818
1919
.. towncrier release notes start
2020
21+
pytest 5.1.0 (2019-08-15)
22+
=========================
23+
24+
Removals
25+
--------
26+
27+
- `#5180 <https://github.com/pytest-dev/pytest/issues/5180>`_: As per our policy, the following features have been deprecated in the 4.X series and are now
28+
removed:
29+
30+
* ``Request.getfuncargvalue``: use ``Request.getfixturevalue`` instead.
31+
32+
* ``pytest.raises`` and ``pytest.warns`` no longer support strings as the second argument.
33+
34+
* ``message`` parameter of ``pytest.raises``.
35+
36+
* ``pytest.raises``, ``pytest.warns`` and ``ParameterSet.param`` now use native keyword-only
37+
syntax. This might change the exception message from previous versions, but they still raise
38+
``TypeError`` on unknown keyword arguments as before.
39+
40+
* ``pytest.config`` global variable.
41+
42+
* ``tmpdir_factory.ensuretemp`` method.
43+
44+
* ``pytest_logwarning`` hook.
45+
46+
* ``RemovedInPytest4Warning`` warning type.
47+
48+
* ``request`` is now a reserved name for fixtures.
49+
50+
51+
For more information consult
52+
`Deprecations and Removals <https://docs.pytest.org/en/latest/deprecations.html>`__ in the docs.
53+
54+
55+
- `#5565 <https://github.com/pytest-dev/pytest/issues/5565>`_: Removed unused support code for `unittest2 <https://pypi.org/project/unittest2/>`__.
56+
57+
The ``unittest2`` backport module is no longer
58+
necessary since Python 3.3+, and the small amount of code in pytest to support it also doesn't seem
59+
to be used: after removed, all tests still pass unchanged.
60+
61+
Although our policy is to introduce a deprecation period before removing any features or support
62+
for third party libraries, because this code is apparently not used
63+
at all (even if ``unittest2`` is used by a test suite executed by pytest), it was decided to
64+
remove it in this release.
65+
66+
If you experience a regression because of this, please
67+
`file an issue <https://github.com/pytest-dev/pytest/issues/new>`__.
68+
69+
70+
- `#5615 <https://github.com/pytest-dev/pytest/issues/5615>`_: ``pytest.fail``, ``pytest.xfail`` and ``pytest.skip`` no longer support bytes for the message argument.
71+
72+
This was supported for Python 2 where it was tempting to use ``"message"``
73+
instead of ``u"message"``.
74+
75+
Python 3 code is unlikely to pass ``bytes`` to these functions. If you do,
76+
please decode it to an ``str`` beforehand.
77+
78+
79+
80+
Features
81+
--------
82+
83+
- `#5564 <https://github.com/pytest-dev/pytest/issues/5564>`_: New ``Config.invocation_args`` attribute containing the unchanged arguments passed to ``pytest.main()``.
84+
85+
86+
- `#5576 <https://github.com/pytest-dev/pytest/issues/5576>`_: New `NUMBER <https://docs.pytest.org/en/latest/doctest.html#using-doctest-options>`__
87+
option for doctests to ignore irrelevant differences in floating-point numbers.
88+
Inspired by Sébastien Boisgérault's `numtest <https://github.com/boisgera/numtest>`__
89+
extension for doctest.
90+
91+
92+
93+
Improvements
94+
------------
95+
96+
- `#5471 <https://github.com/pytest-dev/pytest/issues/5471>`_: JUnit XML now includes a timestamp and hostname in the testsuite tag.
97+
98+
99+
- `#5707 <https://github.com/pytest-dev/pytest/issues/5707>`_: Time taken to run the test suite now includes a human-readable representation when it takes over
100+
60 seconds, for example::
101+
102+
===== 2 failed in 102.70s (0:01:42) =====
103+
104+
105+
106+
Bug Fixes
107+
---------
108+
109+
- `#4344 <https://github.com/pytest-dev/pytest/issues/4344>`_: Fix RuntimeError/StopIteration when trying to collect package with "__init__.py" only.
110+
111+
112+
- `#5115 <https://github.com/pytest-dev/pytest/issues/5115>`_: Warnings issued during ``pytest_configure`` are explicitly not treated as errors, even if configured as such, because it otherwise completely breaks pytest.
113+
114+
115+
- `#5477 <https://github.com/pytest-dev/pytest/issues/5477>`_: The XML file produced by ``--junitxml`` now correctly contain a ``<testsuites>`` root element.
116+
117+
118+
- `#5523 <https://github.com/pytest-dev/pytest/issues/5523>`_: Fixed using multiple short options together in the command-line (for example ``-vs``) in Python 3.8+.
119+
120+
121+
- `#5524 <https://github.com/pytest-dev/pytest/issues/5524>`_: Fix issue where ``tmp_path`` and ``tmpdir`` would not remove directories containing files marked as read-only,
122+
which could lead to pytest crashing when executed a second time with the ``--basetemp`` option.
123+
124+
125+
- `#5537 <https://github.com/pytest-dev/pytest/issues/5537>`_: Replace ``importlib_metadata`` backport with ``importlib.metadata`` from the
126+
standard library on Python 3.8+.
127+
128+
129+
- `#5578 <https://github.com/pytest-dev/pytest/issues/5578>`_: Improve type checking for some exception-raising functions (``pytest.xfail``, ``pytest.skip``, etc)
130+
so they provide better error messages when users meant to use marks (for example ``@pytest.xfail``
131+
instead of ``@pytest.mark.xfail``).
132+
133+
134+
- `#5606 <https://github.com/pytest-dev/pytest/issues/5606>`_: Fixed internal error when test functions were patched with objects that cannot be compared
135+
for truth values against others, like ``numpy`` arrays.
136+
137+
138+
- `#5634 <https://github.com/pytest-dev/pytest/issues/5634>`_: ``pytest.exit`` is now correctly handled in ``unittest`` cases.
139+
This makes ``unittest`` cases handle ``quit`` from pytest's pdb correctly.
140+
141+
142+
- `#5650 <https://github.com/pytest-dev/pytest/issues/5650>`_: Improved output when parsing an ini configuration file fails.
143+
144+
145+
- `#5701 <https://github.com/pytest-dev/pytest/issues/5701>`_: Fix collection of ``staticmethod`` objects defined with ``functools.partial``.
146+
147+
148+
- `#5734 <https://github.com/pytest-dev/pytest/issues/5734>`_: Skip async generator test functions, and update the warning message to refer to ``async def`` functions.
149+
150+
151+
152+
Improved Documentation
153+
----------------------
154+
155+
- `#5669 <https://github.com/pytest-dev/pytest/issues/5669>`_: Add docstring for ``Testdir.copy_example``.
156+
157+
158+
159+
Trivial/Internal Changes
160+
------------------------
161+
162+
- `#5095 <https://github.com/pytest-dev/pytest/issues/5095>`_: XML files of the ``xunit2`` family are now validated against the schema by pytest's own test suite
163+
to avoid future regressions.
164+
165+
166+
- `#5516 <https://github.com/pytest-dev/pytest/issues/5516>`_: Cache node splitting function which can improve collection performance in very large test suites.
167+
168+
169+
- `#5603 <https://github.com/pytest-dev/pytest/issues/5603>`_: Simplified internal ``SafeRepr`` class and removed some dead code.
170+
171+
172+
- `#5664 <https://github.com/pytest-dev/pytest/issues/5664>`_: When invoking pytest's own testsuite with ``PYTHONDONTWRITEBYTECODE=1``,
173+
the ``test_xfail_handling`` test no longer fails.
174+
175+
176+
- `#5684 <https://github.com/pytest-dev/pytest/issues/5684>`_: Replace manual handling of ``OSError.errno`` in the codebase by new ``OSError`` subclasses (``PermissionError``, ``FileNotFoundError``, etc.).
177+
178+
21179
pytest 5.0.1 (2019-07-04)
22180
=========================
23181

changelog/4344.bugfix.rst

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

changelog/5115.bugfix.rst

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

changelog/5516.trivial.rst

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

changelog/5524.bugfix.rst

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

changelog/5578.bugfix.rst

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

0 commit comments

Comments
 (0)