Opened 3 years ago
Closed 3 years 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: | medium | Keywords: | |
| Cc: |
Description
New minor version. Seems to be a lot of releases lately.
Change History (3)
comment:1 by , 3 years ago
comment:2 by , 3 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:3 by , 3 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.

Features
consider_namespace_packagesconfiguration option, defaulting toFalse.verbosity_test_casesconfiguration option for fine-grained control of test execution verbosity. Seepytest.fine_grained_verbosityfor more details.Improvements
pytest.warnsnow validates thatwarnings.warnwas called with astror aWarning. Currently in Python it is possible to use other types, however this causes an exception whenwarnings.filterwarningsis 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-inifor paths in invocations without a configuration file defined, the current working directory is used as the relative directory.--import-mode=importlibnow 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_excfor 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-modeoption to the logging plugin, enabling appending to log-files. This option accepts either"w"or"a"and defaults to"w".Bug Fixes
--pyargs.setup_modulexunit-style fixtures are not executed when--doctest-modulesis passed.stacklevelused when warning about marks used on fixtures.8.0.2where tests created usingtmp_pathhave been collected multiple times in CI under Windows.Improved Documentation
tmp_pathfixture in more detail.Trivial/Internal Changes
FixtureManager._getautousenames()now takes aNodeitself instead of the nodeid.FixtureManager.getfixturedefs()now takes theNodeitself 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.