You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: doc/en/changelog.rst
+41
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,47 @@ with advance notice in the **Deprecations** section of releases.
28
28
29
29
.. towncrier release notes start
30
30
31
+
pytest 7.1.3 (2022-08-31)
32
+
=========================
33
+
34
+
Bug Fixes
35
+
---------
36
+
37
+
- `#10060 <https://github.com/pytest-dev/pytest/issues/10060>`_: When running with ``--pdb``, ``TestCase.tearDown`` is no longer called for tests when the *class* has been skipped via ``unittest.skip`` or ``pytest.mark.skip``.
38
+
39
+
40
+
- `#10190 <https://github.com/pytest-dev/pytest/issues/10190>`_: Invalid XML characters in setup or teardown error messages are now properly escaped for JUnit XML reports.
41
+
42
+
43
+
- `#10230 <https://github.com/pytest-dev/pytest/issues/10230>`_: Ignore ``.py`` files created by ``pyproject.toml``-based editable builds introduced in `pip 21.3 <https://pip.pypa.io/en/stable/news/#v21-3>`__.
44
+
45
+
46
+
- `#3396 <https://github.com/pytest-dev/pytest/issues/3396>`_: Doctests now respect the ``--import-mode`` flag.
47
+
48
+
49
+
- `#9514 <https://github.com/pytest-dev/pytest/issues/9514>`_: Type-annotate ``FixtureRequest.param`` as ``Any`` as a stop gap measure until :issue:`8073` is fixed.
50
+
51
+
52
+
- `#9791 <https://github.com/pytest-dev/pytest/issues/9791>`_: Fixed a path handling code in ``rewrite.py`` that seems to work fine, but was incorrect and fails in some systems.
53
+
54
+
55
+
- `#9917 <https://github.com/pytest-dev/pytest/issues/9917>`_: Fixed string representation for :func:`pytest.approx` when used to compare tuples.
56
+
57
+
58
+
59
+
Improved Documentation
60
+
----------------------
61
+
62
+
- `#9937 <https://github.com/pytest-dev/pytest/issues/9937>`_: Explicit note that :fixture:`tmpdir` fixture is discouraged in favour of :fixture:`tmp_path`.
63
+
64
+
65
+
66
+
Trivial/Internal Changes
67
+
------------------------
68
+
69
+
- `#10114 <https://github.com/pytest-dev/pytest/issues/10114>`_: Replace `atomicwrites <https://github.com/untitaker/python-atomicwrites>`__ dependency on windows with `os.replace`.
Copy file name to clipboardexpand all lines: doc/en/how-to/fixtures.rst
+10-4
Original file line number
Diff line number
Diff line change
@@ -735,8 +735,8 @@ does offer some nuances for when you're in a pinch.
735
735
.. code-block:: pytest
736
736
737
737
$ pytest -q test_emaillib.py
738
-
. [100%]
739
-
1 passed in 0.12s
738
+
. [100%]
739
+
1 passed in 0.12s
740
740
741
741
Note on finalizer order
742
742
""""""""""""""""""""""""
@@ -772,13 +772,15 @@ For yield fixtures, the first teardown code to run is from the right-most fixtur
772
772
$ pytest -s test_finalizers.py
773
773
=========================== test session starts ============================
774
774
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
775
+
rootdir: /home/sweet/project
775
776
collected 1 item
776
777
777
778
test_finalizers.py test_bar
778
779
.after_yield_2
779
780
after_yield_1
780
781
781
782
783
+
============================ 1 passed in 0.12s =============================
782
784
783
785
For finalizers, the first fixture to run is last call to `request.addfinalizer`.
784
786
@@ -804,12 +806,16 @@ For finalizers, the first fixture to run is last call to `request.addfinalizer`.
804
806
$ pytest -s test_finalizers.py
805
807
=========================== test session starts ============================
806
808
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
809
+
rootdir: /home/sweet/project
807
810
collected 1 item
808
811
809
812
test_finalizers.py test_bar
810
813
.finalizer_1
811
814
finalizer_2
812
815
816
+
817
+
============================ 1 passed in 0.12s =============================
818
+
813
819
This is so because yield fixtures use `addfinalizer` behind the scenes: when the fixture executes, `addfinalizer` registers a function that resumes the generator, which in turn calls the teardown code.
814
820
815
821
@@ -1411,7 +1417,7 @@ Running the above tests results in the following test IDs being used:
1411
1417
=========================== test session starts ============================
1412
1418
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
1413
1419
rootdir: /home/sweet/project
1414
-
collected 11 items
1420
+
collected 12 items
1415
1421
1416
1422
<Module test_anothersmtp.py>
1417
1423
<Function test_showhelo[smtp.gmail.com]>
@@ -1431,7 +1437,7 @@ Running the above tests results in the following test IDs being used:
1431
1437
<Function test_ehlo[mail.python.org]>
1432
1438
<Function test_noop[mail.python.org]>
1433
1439
1434
-
======================= 11 tests collected in 0.12s ========================
1440
+
======================= 12 tests collected in 0.12s ========================
0 commit comments