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: CHANGELOG.rst
+133Lines changed: 133 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,139 @@ with advance notice in the **Deprecations** section of releases.
18
18
19
19
.. towncrier release notes start
20
20
21
+
pytest 4.5.0 (2019-05-11)
22
+
=========================
23
+
24
+
Features
25
+
--------
26
+
27
+
- `#4826 <https://github.com/pytest-dev/pytest/issues/4826>`_: A warning is now emitted when unknown marks are used as a decorator.
28
+
This is often due to a typo, which can lead to silently broken tests.
29
+
30
+
31
+
- `#4907 <https://github.com/pytest-dev/pytest/issues/4907>`_: Show XFail reason as part of JUnitXML message field.
32
+
33
+
34
+
- `#5013 <https://github.com/pytest-dev/pytest/issues/5013>`_: Messages from crash reports are displayed within test summaries now, truncated to the terminal width.
35
+
36
+
37
+
- `#5023 <https://github.com/pytest-dev/pytest/issues/5023>`_: New flag ``--strict-markers`` that triggers an error when unknown markers (e.g. those not registered using the `markers option`_ in the configuration file) are used in the test suite.
38
+
39
+
The existing ``--strict`` option has the same behavior currently, but can be augmented in the future for additional checks.
- `#5026 <https://github.com/pytest-dev/pytest/issues/5026>`_: Assertion failure messages for sequences and dicts contain the number of different items now.
45
+
46
+
47
+
- `#5034 <https://github.com/pytest-dev/pytest/issues/5034>`_: Improve reporting with ``--lf`` and ``--ff`` (run-last-failure).
48
+
49
+
50
+
- `#5035 <https://github.com/pytest-dev/pytest/issues/5035>`_: The ``--cache-show`` option/action accepts an optional glob to show only matching cache entries.
51
+
52
+
53
+
- `#5059 <https://github.com/pytest-dev/pytest/issues/5059>`_: Standard input (stdin) can be given to pytester's ``Testdir.run()`` and ``Testdir.popen()``.
54
+
55
+
56
+
- `#5068 <https://github.com/pytest-dev/pytest/issues/5068>`_: The ``-r`` option learnt about ``A`` to display all reports (including passed ones) in the short test summary.
57
+
58
+
59
+
- `#5108 <https://github.com/pytest-dev/pytest/issues/5108>`_: The short test summary is displayed after passes with output (``-rP``).
60
+
61
+
62
+
- `#5172 <https://github.com/pytest-dev/pytest/issues/5172>`_: The ``--last-failed`` (``--lf``) option got smarter and will now skip entire files if all tests
63
+
of that test file have passed in previous runs, greatly speeding up collection.
64
+
65
+
66
+
- `#5177 <https://github.com/pytest-dev/pytest/issues/5177>`_: Introduce new specific warning ``PytestWarning`` subclasses to make it easier to filter warnings based on the class, rather than on the message. The new subclasses are:
67
+
68
+
69
+
* ``PytestAssertRewriteWarning``
70
+
71
+
* ``PytestCacheWarning``
72
+
73
+
* ``PytestCollectionWarning``
74
+
75
+
* ``PytestConfigWarning``
76
+
77
+
* ``PytestUnhandledCoroutineWarning``
78
+
79
+
* ``PytestUnknownMarkWarning``
80
+
81
+
82
+
- `#5202 <https://github.com/pytest-dev/pytest/issues/5202>`_: New ``record_testsuite_property`` session-scoped fixture allows users to log ``<property>`` tags at the ``testsuite``
83
+
level with the ``junitxml`` plugin.
84
+
85
+
The generated XML is compatible with the latest xunit standard, contrary to
86
+
the properties recorded by ``record_property`` and ``record_xml_attribute``.
87
+
88
+
89
+
- `#5214 <https://github.com/pytest-dev/pytest/issues/5214>`_: The default logging format has been changed to improve readability. Here is an
90
+
example of a previous logging message::
91
+
92
+
test_log_cli_enabled_disabled.py 3 CRITICAL critical message logged by test
93
+
94
+
This has now become::
95
+
96
+
CRITICAL root:test_log_cli_enabled_disabled.py:3 critical message logged by test
97
+
98
+
The formatting can be changed through the `log_format <https://docs.pytest.org/en/latest/reference.html#confval-log_format>`__ configuration option.
99
+
100
+
101
+
- `#5220 <https://github.com/pytest-dev/pytest/issues/5220>`_: ``--fixtures`` now also shows fixture scope for scopes other than ``"function"``.
102
+
103
+
104
+
105
+
Bug Fixes
106
+
---------
107
+
108
+
- `#5113 <https://github.com/pytest-dev/pytest/issues/5113>`_: Deselected items from plugins using ``pytest_collect_modifyitems`` as a hookwrapper are correctly reported now.
109
+
110
+
111
+
- `#5144 <https://github.com/pytest-dev/pytest/issues/5144>`_: With usage errors ``exitstatus`` is set to ``EXIT_USAGEERROR`` in the ``pytest_sessionfinish`` hook now as expected.
112
+
113
+
114
+
- `#5235 <https://github.com/pytest-dev/pytest/issues/5235>`_: ``outcome.exit`` is not used with ``EOF`` in the pdb wrapper anymore, but only with ``quit``.
115
+
116
+
117
+
118
+
Improved Documentation
119
+
----------------------
120
+
121
+
- `#4935 <https://github.com/pytest-dev/pytest/issues/4935>`_: Expand docs on registering marks and the effect of ``--strict``.
122
+
123
+
124
+
125
+
Trivial/Internal Changes
126
+
------------------------
127
+
128
+
- `#4942 <https://github.com/pytest-dev/pytest/issues/4942>`_: ``logging.raiseExceptions`` is not set to ``False`` anymore.
129
+
130
+
131
+
- `#5013 <https://github.com/pytest-dev/pytest/issues/5013>`_: pytest now depends on `wcwidth <https://pypi.org/project/wcwidth>`__ to properly track unicode character sizes for more precise terminal output.
132
+
133
+
134
+
- `#5059 <https://github.com/pytest-dev/pytest/issues/5059>`_: pytester's ``Testdir.popen()`` uses ``stdout`` and ``stderr`` via keyword arguments with defaults now (``subprocess.PIPE``).
135
+
136
+
137
+
- `#5069 <https://github.com/pytest-dev/pytest/issues/5069>`_: The code for the short test summary in the terminal was moved to the terminal plugin.
138
+
139
+
140
+
- `#5082 <https://github.com/pytest-dev/pytest/issues/5082>`_: Improved validation of kwargs for various methods in the pytester plugin.
141
+
142
+
143
+
- `#5202 <https://github.com/pytest-dev/pytest/issues/5202>`_: ``record_property`` now emits a ``PytestWarning`` when used with ``junit_family=xunit2``: the fixture generates
144
+
``property`` tags as children of ``testcase``, which is not permitted according to the most
0 commit comments