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-2
Original file line number
Diff line number
Diff line change
@@ -733,6 +733,8 @@ does offer some nuances for when you're in a pinch.
733
733
.. code-block:: pytest
734
734
735
735
$ pytest -q test_emaillib.py
736
+
. [100%]
737
+
1 passed in 0.12s
736
738
. [100%]
737
739
1 passed in 0.12s
738
740
@@ -770,13 +772,15 @@ For yield fixtures, the first teardown code to run is from the right-most fixtur
770
772
$ pytest -s test_finalizers.py
771
773
=========================== test session starts ============================
772
774
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
775
+
rootdir: /home/sweet/project
773
776
collected 1 item
774
777
775
778
test_finalizers.py test_bar
776
779
.after_yield_2
777
780
after_yield_1
778
781
779
782
783
+
============================ 1 passed in 0.12s =============================
780
784
781
785
For finalizers, the first fixture to run is last call to `request.addfinalizer`.
782
786
@@ -802,12 +806,16 @@ For finalizers, the first fixture to run is last call to `request.addfinalizer`.
802
806
$ pytest -s test_finalizers.py
803
807
=========================== test session starts ============================
804
808
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
809
+
rootdir: /home/sweet/project
805
810
collected 1 item
806
811
807
812
test_finalizers.py test_bar
808
813
.finalizer_1
809
814
finalizer_2
810
815
816
+
817
+
============================ 1 passed in 0.12s =============================
818
+
811
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.
812
820
813
821
@@ -1407,7 +1415,7 @@ Running the above tests results in the following test IDs being used:
1407
1415
=========================== test session starts ============================
1408
1416
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
1409
1417
rootdir: /home/sweet/project
1410
-
collected 11 items
1418
+
collected 12 items
1411
1419
1412
1420
<Module test_anothersmtp.py>
1413
1421
<Function test_showhelo[smtp.gmail.com]>
@@ -1427,7 +1435,7 @@ Running the above tests results in the following test IDs being used:
1427
1435
<Function test_ehlo[mail.python.org]>
1428
1436
<Function test_noop[mail.python.org]>
1429
1437
1430
-
======================= 11 tests collected in 0.12s ========================
1438
+
======================= 12 tests collected in 0.12s ========================
0 commit comments