Skip to content

Commit 6be0a3c

Browse files
committed
Prepare release version 8.0.0rc2
1 parent 44ffe07 commit 6be0a3c

14 files changed

+108
-22
lines changed

changelog/11233.feature.rst

-5
This file was deleted.

changelog/11706.bugfix.rst

-1
This file was deleted.

changelog/11758.bugfix.rst

-2
This file was deleted.

changelog/11825.improvement.rst

-1
This file was deleted.

changelog/9765.bugfix.rst

-3
This file was deleted.

doc/en/announce/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Release announcements
66
:maxdepth: 2
77

88

9+
release-8.0.0rc2
910
release-8.0.0rc1
1011
release-7.4.4
1112
release-7.4.3

doc/en/announce/release-8.0.0rc2.rst

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
pytest-8.0.0rc2
2+
=======================================
3+
4+
The pytest team is proud to announce the 8.0.0rc2 prerelease!
5+
6+
This is a prerelease, not intended for production use, but to test the upcoming features and improvements
7+
in order to catch any major problems before the final version is released to the major public.
8+
9+
We appreciate your help testing this out before the final release, making sure to report any
10+
regressions to our issue tracker:
11+
12+
https://github.com/pytest-dev/pytest/issues
13+
14+
When doing so, please include the string ``[prerelease]`` in the title.
15+
16+
You can upgrade from PyPI via:
17+
18+
pip install pytest==8.0.0rc2
19+
20+
Users are encouraged to take a look at the CHANGELOG carefully:
21+
22+
https://docs.pytest.org/en/release-8.0.0rc2/changelog.html
23+
24+
Thanks to all the contributors to this release:
25+
26+
* Ben Brown
27+
* Bruno Oliveira
28+
* Ran Benita
29+
30+
31+
Happy testing,
32+
The pytest Development Team

doc/en/changelog.rst

+31
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,37 @@ with advance notice in the **Deprecations** section of releases.
2828

2929
.. towncrier release notes start
3030
31+
pytest 8.0.0rc2 (2024-01-17)
32+
============================
33+
34+
35+
Improvements
36+
------------
37+
38+
- `#11233 <https://github.com/pytest-dev/pytest/issues/11233>`_: Improvements to ``-r`` for xfailures and xpasses:
39+
40+
* Report tracebacks for xfailures when ``-rx`` is set.
41+
* Report captured output for xpasses when ``-rX`` is set.
42+
* For xpasses, add ``-`` in summary between test name and reason, to match how xfail is displayed.
43+
44+
- `#11825 <https://github.com/pytest-dev/pytest/issues/11825>`_: The :hook:`pytest_plugin_registered` hook has a new ``plugin_name`` parameter containing the name by which ``plugin`` is registered.
45+
46+
47+
Bug Fixes
48+
---------
49+
50+
- `#11706 <https://github.com/pytest-dev/pytest/issues/11706>`_: Fix reporting of teardown errors in higher-scoped fixtures when using `--maxfail` or `--stepwise`.
51+
52+
53+
- `#11758 <https://github.com/pytest-dev/pytest/issues/11758>`_: Fixed ``IndexError: string index out of range`` crash in ``if highlighted[-1] == "\n" and source[-1] != "\n"``.
54+
This bug was introduced in pytest 8.0.0rc1.
55+
56+
57+
- `#9765 <https://github.com/pytest-dev/pytest/issues/9765>`_, `#11816 <https://github.com/pytest-dev/pytest/issues/11816>`_: Fixed a frustrating bug that afflicted some users with the only error being ``assert mod not in mods``. The issue was caused by the fact that ``str(Path(mod))`` and ``mod.__file__`` don't necessarily produce the same string, and was being erroneously used interchangably in some places in the code.
58+
59+
This fix also broke the internal API of ``PytestPluginManager.consider_conftest`` by introducing a new parameter -- we mention this in case it is being used by external code, even if marked as *private*.
60+
61+
3162
pytest 8.0.0rc1 (2023-12-30)
3263
============================
3364

doc/en/example/parametrize.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ objects, they are still using the default pytest representation:
162162
rootdir: /home/sweet/project
163163
collected 8 items
164164
165-
<Dir parametrize.rst-189>
165+
<Dir parametrize.rst-192>
166166
<Module test_time.py>
167167
<Function test_timedistance_v0[a0-b0-expected0]>
168168
<Function test_timedistance_v0[a1-b1-expected1]>
@@ -239,7 +239,7 @@ If you just collect tests you'll also nicely see 'advanced' and 'basic' as varia
239239
rootdir: /home/sweet/project
240240
collected 4 items
241241
242-
<Dir parametrize.rst-189>
242+
<Dir parametrize.rst-192>
243243
<Module test_scenarios.py>
244244
<Class TestSampleWithScenarios>
245245
<Function test_demo1[basic]>
@@ -318,7 +318,7 @@ Let's first see how it looks like at collection time:
318318
rootdir: /home/sweet/project
319319
collected 2 items
320320
321-
<Dir parametrize.rst-189>
321+
<Dir parametrize.rst-192>
322322
<Module test_backends.py>
323323
<Function test_db_initialized[d1]>
324324
<Function test_db_initialized[d2]>
@@ -503,10 +503,10 @@ Running it results in some skips if we don't have all the python interpreters in
503503
.. code-block:: pytest
504504
505505
. $ pytest -rs -q multipython.py
506-
ssssssssssss...ssssssssssss [100%]
506+
ssssssssssssssssssssssss... [100%]
507507
========================= short test summary info ==========================
508508
SKIPPED [12] multipython.py:68: 'python3.9' not found
509-
SKIPPED [12] multipython.py:68: 'python3.11' not found
509+
SKIPPED [12] multipython.py:68: 'python3.10' not found
510510
3 passed, 24 skipped in 0.12s
511511
512512
Parametrization of optional implementations/imports

doc/en/example/pythoncollection.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ The test collection would look like this:
152152
configfile: pytest.ini
153153
collected 2 items
154154
155-
<Dir pythoncollection.rst-190>
155+
<Dir pythoncollection.rst-193>
156156
<Module check_myapp.py>
157157
<Class CheckMyApp>
158158
<Function simple_check>
@@ -215,7 +215,7 @@ You can always peek at the collection tree without running tests like this:
215215
configfile: pytest.ini
216216
collected 3 items
217217
218-
<Dir pythoncollection.rst-190>
218+
<Dir pythoncollection.rst-193>
219219
<Dir CWD>
220220
<Module pythoncollection.py>
221221
<Function test_function>

doc/en/example/simple.rst

+25
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,31 @@ If we run this:
660660
E assert 0
661661
662662
test_step.py:11: AssertionError
663+
================================ XFAILURES =================================
664+
______________________ TestUserHandling.test_deletion ______________________
665+
666+
item = <Function test_deletion>
667+
668+
def pytest_runtest_setup(item):
669+
if "incremental" in item.keywords:
670+
# retrieve the class name of the test
671+
cls_name = str(item.cls)
672+
# check if a previous test has failed for this class
673+
if cls_name in _test_failed_incremental:
674+
# retrieve the index of the test (if parametrize is used in combination with incremental)
675+
parametrize_index = (
676+
tuple(item.callspec.indices.values())
677+
if hasattr(item, "callspec")
678+
else ()
679+
)
680+
# retrieve the name of the first test function to fail for this class name and index
681+
test_name = _test_failed_incremental[cls_name].get(parametrize_index, None)
682+
# if name found, test has failed for the combination of class name & test name
683+
if test_name is not None:
684+
> pytest.xfail(f"previous test failed ({test_name})")
685+
E _pytest.outcomes.XFailed: previous test failed (test_modification)
686+
687+
conftest.py:47: XFailed
663688
========================= short test summary info ==========================
664689
XFAIL test_step.py::TestUserHandling::test_deletion - reason: previous test failed (test_modification)
665690
================== 1 failed, 2 passed, 1 xfailed in 0.12s ==================

doc/en/getting-started.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Install ``pytest``
2222
.. code-block:: bash
2323
2424
$ pytest --version
25-
pytest 8.0.0rc1
25+
pytest 8.0.0rc2
2626
2727
.. _`simpletest`:
2828

doc/en/how-to/fixtures.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ Running the above tests results in the following test IDs being used:
14181418
rootdir: /home/sweet/project
14191419
collected 12 items
14201420
1421-
<Dir fixtures.rst-208>
1421+
<Dir fixtures.rst-211>
14221422
<Module test_anothersmtp.py>
14231423
<Function test_showhelo[smtp.gmail.com]>
14241424
<Function test_showhelo[mail.python.org]>

doc/en/how-to/output.rst

+10-1
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,19 @@ Example:
404404
E assert 0
405405
406406
test_example.py:14: AssertionError
407+
================================ XFAILURES =================================
408+
________________________________ test_xfail ________________________________
409+
410+
def test_xfail():
411+
> pytest.xfail("xfailing this test")
412+
E _pytest.outcomes.XFailed: xfailing this test
413+
414+
test_example.py:26: XFailed
415+
================================= XPASSES ==================================
407416
========================= short test summary info ==========================
408417
SKIPPED [1] test_example.py:22: skipping this test
409418
XFAIL test_example.py::test_xfail - reason: xfailing this test
410-
XPASS test_example.py::test_xpass always xfail
419+
XPASS test_example.py::test_xpass - always xfail
411420
ERROR test_example.py::test_error - assert 0
412421
FAILED test_example.py::test_fail - assert 0
413422
== 1 failed, 1 passed, 1 skipped, 1 xfailed, 1 xpassed, 1 error in 0.12s ===

0 commit comments

Comments
 (0)