Opened 13 months ago
Closed 13 months ago
#19401 closed enhancement (fixed)
pytest-8.1.0 (Python module)
Reported by: | Bruce Dubbs | Owned by: | Douglas R. Reno |
---|---|---|---|
Priority: | normal | Milestone: | 12.2 |
Component: | BOOK | Version: | git |
Severity: | normal | Keywords: | |
Cc: |
Description ¶
New minor version. Seems to be a lot of releases lately.
Change History (3)
comment:1 by , 13 months ago
comment:2 by , 13 months ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 13 months ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Features
consider_namespace_packages
configuration option, defaulting toFalse
.verbosity_test_cases
configuration option for fine-grained control of test execution verbosity. Seepytest.fine_grained_verbosity
for more details.Improvements
pytest.warns
now validates thatwarnings.warn
was called with astr
or aWarning
. Currently in Python it is possible to use other types, however this causes an exception whenwarnings.filterwarnings
is used to filter those warnings (see CPython #103577 for a discussion). While this can be considered a bug in CPython, we decided to put guards in pytest as the error message produced without this check in place is confusing.--override-ini
for paths in invocations without a configuration file defined, the current working directory is used as the relative directory.--import-mode=importlib
now tries to import modules using the standard import mechanism (but still without changingsys.path
), falling back to importing modules directly only if that fails.iter_parents()
helper method on nodes. It is similar tolistchain
, but goes from bottom to top, and returns an iterator, not a list.sys.last_exc
for post-mortem debugging on Python>=3.12.pyproject.toml
(even without a[tool.pytest.ini_options]
table) will be considered as the configuration file and define therootdir
.--log-file-mode
option to the logging plugin, enabling appending to log-files. This option accepts either"w"
or"a"
and defaults to"w"
.Bug Fixes
--pyargs
.setup_module
xunit-style fixtures are not executed when--doctest-modules
is passed.stacklevel
used when warning about marks used on fixtures.8.0.2
where tests created usingtmp_path
have been collected multiple times in CI under Windows.Improved Documentation
tmp_path
fixture in more detail.Trivial/Internal Changes
FixtureManager._getautousenames()
now takes aNode
itself instead of the nodeid.FixtureManager.getfixturedefs()
now takes theNode
itself instead of the nodeid._pytest.nodes.iterparentnodeids()
function is removed without replacement. Prefer to traverse the node hierarchy itself instead. If you really need to, copy the function from the previous pytest release.