Skip to content

Commit 08d8b71

Browse files
Merge branch 'main' into Improvement-remove-prune_dependency_tree
2 parents fc92f9f + 7500fe4 commit 08d8b71

25 files changed

+537
-251
lines changed

.github/workflows/update-plugin-list.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Setup Python
2828
uses: actions/setup-python@v4
2929
with:
30-
python-version: "3.8"
30+
python-version: "3.11"
3131
cache: pip
3232
- name: requests-cache
3333
uses: actions/cache@v3

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repos:
55
- id: black
66
args: [--safe, --quiet]
77
- repo: https://github.com/asottile/blacken-docs
8-
rev: 1.15.0
8+
rev: 1.16.0
99
hooks:
1010
- id: blacken-docs
1111
additional_dependencies: [black==23.7.0]
@@ -56,7 +56,7 @@ repos:
5656
hooks:
5757
- id: python-use-type-annotations
5858
- repo: https://github.com/pre-commit/mirrors-mypy
59-
rev: v1.4.1
59+
rev: v1.5.1
6060
hooks:
6161
- id: mypy
6262
files: ^(src/|testing/)

changelog/11218.trivial.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
(This entry is meant to assist plugins which access private pytest internals to instantiate ``FixtureRequest`` objects.)
2+
3+
:class:`~pytest.FixtureRequest` is now an abstract class which can't be instantiated directly.
4+
A new concrete ``TopRequest`` subclass of ``FixtureRequest`` has been added for the ``request`` fixture in test functions,
5+
as counterpart to the existing ``SubRequest`` subclass for the ``request`` fixture in fixture functions.

changelog/11333.trivial.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Corrected the spelling of ``Config.ArgsSource.INVOCATION_DIR``.
2+
The previous spelling ``INCOVATION_DIR`` remains as an alias.

changelog/7966.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Removes unhelpful error message from assertion rewrite mechanism when exceptions raised in __iter__ methods, and instead treats them as un-iterable.

doc/en/explanation/anatomy.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ a function/method call.
3434

3535
**Assert** is where we look at that resulting state and check if it looks how
3636
we'd expect after the dust has settled. It's where we gather evidence to say the
37-
behavior does or does not aligns with what we expect. The ``assert`` in our test
37+
behavior does or does not align with what we expect. The ``assert`` in our test
3838
is where we take that measurement/observation and apply our judgement to it. If
3939
something should be green, we'd say ``assert thing == "green"``.
4040

doc/en/reference/plugin_list.rst

Lines changed: 308 additions & 132 deletions
Large diffs are not rendered by default.

doc/en/reference/reference.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ pytest.mark.xfail
237237

238238
Marks a test function as *expected to fail*.
239239

240-
.. py:function:: pytest.mark.xfail(condition=None, *, reason=None, raises=None, run=True, strict=False)
240+
.. py:function:: pytest.mark.xfail(condition=None, *, reason=None, raises=None, run=True, strict=xfail_strict)
241241
242242
:type condition: bool or str
243243
:param condition:
@@ -249,17 +249,19 @@ Marks a test function as *expected to fail*.
249249
:keyword Type[Exception] raises:
250250
Exception subclass (or tuple of subclasses) expected to be raised by the test function; other exceptions will fail the test.
251251
:keyword bool run:
252-
If the test function should actually be executed. If ``False``, the function will always xfail and will
252+
Whether the test function should actually be executed. If ``False``, the function will always xfail and will
253253
not be executed (useful if a function is segfaulting).
254254
:keyword bool strict:
255-
* If ``False`` (the default) the function will be shown in the terminal output as ``xfailed`` if it fails
255+
* If ``False`` the function will be shown in the terminal output as ``xfailed`` if it fails
256256
and as ``xpass`` if it passes. In both cases this will not cause the test suite to fail as a whole. This
257257
is particularly useful to mark *flaky* tests (tests that fail at random) to be tackled later.
258258
* If ``True``, the function will be shown in the terminal output as ``xfailed`` if it fails, but if it
259259
unexpectedly passes then it will **fail** the test suite. This is particularly useful to mark functions
260260
that are always failing and there should be a clear indication if they unexpectedly start to pass (for example
261261
a new release of a library fixes a known bug).
262262

263+
Defaults to :confval:`xfail_strict`, which is ``False`` by default.
264+
263265

264266
Custom marks
265267
~~~~~~~~~~~~
@@ -1638,11 +1640,11 @@ passed multiple times. The expected format is ``name=value``. For example::
16381640
Additionally, ``pytest`` will attempt to intelligently identify and ignore a
16391641
virtualenv by the presence of an activation script. Any directory deemed to
16401642
be the root of a virtual environment will not be considered during test
1641-
collection unless ``‑‑collect‑in‑virtualenv`` is given. Note also that
1642-
``norecursedirs`` takes precedence over ``‑‑collect‑in‑virtualenv``; e.g. if
1643+
collection unless ``--collect-in-virtualenv`` is given. Note also that
1644+
``norecursedirs`` takes precedence over ``--collect-in-virtualenv``; e.g. if
16431645
you intend to run tests in a virtualenv with a base directory that matches
16441646
``'.*'`` you *must* override ``norecursedirs`` in addition to using the
1645-
``‑‑collect‑in‑virtualenv`` flag.
1647+
``--collect-in-virtualenv`` flag.
16461648

16471649

16481650
.. confval:: python_classes

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ python_classes = ["Test", "Acceptance"]
1717
python_functions = ["test"]
1818
# NOTE: "doc" is not included here, but gets tested explicitly via "doctesting".
1919
testpaths = ["testing"]
20-
norecursedirs = ["testing/example_scripts"]
20+
norecursedirs = [
21+
"testing/example_scripts",
22+
".*",
23+
"build",
24+
"dist",
25+
]
2126
xfail_strict = true
2227
filterwarnings = [
2328
"error",

scripts/update-plugin-list.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
)
4545
ADDITIONAL_PROJECTS = { # set of additional projects to consider as plugins
4646
"logassert",
47+
"nuts",
4748
}
4849

4950

0 commit comments

Comments
 (0)