Repository navigation
chore(deps): update python test tooling - #532
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
renovate
Bot
force-pushed
the
renovate/python-test-tooling
branch
9 times, most recently
from
October 4, 2026 21:23
37d2724 to
6a6cb4d
Compare
renovate
Bot
force-pushed
the
renovate/python-test-tooling
branch
8 times, most recently
from
October 11, 2026 08:54
41f8ead to
8c389e3
Compare
renovate
Bot
force-pushed
the
renovate/python-test-tooling
branch
4 times, most recently
from
October 15, 2026 10:11
439aa9a to
ef44167
Compare
Contributor
Author
|
renovate
Bot
force-pushed
the
renovate/python-test-tooling
branch
7 times, most recently
from
October 21, 2026 08:49
1b4896a to
7618812
Compare
renovate
Bot
force-pushed
the
renovate/python-test-tooling
branch
2 times, most recently
from
October 23, 2026 10:58
24cffd0 to
2cda2e4
Compare
holmboe
added a commit
that referenced
this pull request
Oct 24, 2026
tox 4.67 requires Python 3.11. With rangeStrategy bump, Renovate raised the dev group's floor to tox>=4.67.1, which leaves uv no tox for the python_full_version == '3.10.*' split, so every leg of #532 failed at uv sync. Lift the rule when 3.10 is dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
renovate
Bot
force-pushed
the
renovate/python-test-tooling
branch
6 times, most recently
from
October 30, 2026 05:46
b1c7928 to
d2bd6e4
Compare
renovate
Bot
force-pushed
the
renovate/python-test-tooling
branch
from
November 1, 2026 21:55
d2bd6e4 to
45cb0f4
Compare
renovate
Bot
force-pushed
the
renovate/python-test-tooling
branch
from
November 2, 2026 00:32
45cb0f4 to
e228822
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
>=7.13.5→>=7.17.0>=2.3.1→>=2.4.0>=9.0.3→>=9.2.0>=4.22→>=4.66.0>=1.35.2→>=1.37.2>=2.33.0.20260906→>=2.33.0.20261006Release Notes
coveragepy/coveragepy (coverage)
v7.17.0Compare Source
Dropped support for Python 3.10.
Binary wheels are now provided for iOS and Android. This allows the use of
the optimized C tracer on mobile platforms.
Fix: three or more levels of nested
withstatements could make awithline look like a branch with an exit that can never happen. Using the
sys.monitoring core, these phantom branches were reported as partial. Other
cores hid the problem but still counted the phantom branches in the total.
Closes
issue 1987_.Fix: a comment or string that merely mentioned
if True:orwhile True:could mark its line as a branch that is known to be partial,so a branch that never ran was reported as taken. These built-in patterns
now only match at the start of the statement. Closes
issue 2314_.Fix: region detection missed functions defined in unusual places, such as
elseandexceptclauses. This is now fixed.Fix: recent versions of the lcov tool complain if the same function name
appears more than once in a report. Python can have multiple same-named
functions in a few ways, for example, getters/setters or conditionally
defined functions. These are now disambiguated by adding a
@<line number>suffix to the function name. Fixes
issue 2335.Fix: The "Can't combine statement coverage data with branch data" error now
names the two data files it couldn't combine. The :ref:
error description <error_cant_combine>in the docs now lists common causes and how to find theprocess that wrote the file.
Fix: at coverage totals close to 0 or 100, the XML report could get incorrect
line-ratevalues like8.333e-05or1. This is now fixed, closingissue 2293_ andissue 2294_.Fix: a parallel data file saved more than once kept the hash of its first
save in its file name. Combining could then skip it as a duplicate of another
file that had the same data at that point, and delete it, losing the data
recorded after the first save. Each save now updates the hash. This had been
a problem since 7.13.1. Fixes
issue 2338_.Fixes for obscure but legal file names:
File names (and plugin names) can contain control characters, which are
legal in POSIX paths but unsafe in reports: in XML 1.0 they make the
document non-well-formed, and in a terminal they act as escape sequences
(colors, title/clipboard sequences, cursor moves that forge output). Now
the XML report, the text and Markdown summary reports, and
coverage debug datareplace non-printable characters in names. Printable names areunchanged.
A file pattern (from
include,omit, or a[paths]alias)containing a newline sent the glob-to-regex translation into an infinite
loop, hanging the process. Newlines in patterns are now handled like any
other character.
Fixes in the implementation of the C tracer:
If a plugin's
dynamic_source_filenamemethod raised an exception, linesin that function could be recorded as belonging to a different file. Also
fixed some minor memory leaks in the C tracer.
The refcount of
Nonewas mismanaged during function calls, includingcomprehensions. This was unlikely to cause an actual problem, but is now
fixed. Thanks, Andrew Dalke.
The C tracer held borrowed references to dictionary values, which was
unsafe on free-threaded Python. Now it takes its own references.
An internal error while recording a new file could be reported as a
confusing
SystemErrorinstead of the actual exception.Performance: the text summary report (
coverage report) held on to everyfile's parsed source until it finished, so its memory use grew with the size
of the project: ten times or more what 7.14 used on large projects. Now it
keeps only what it needs to print. Fixes
issue 2277_.Performance: HTML reports should be about 5% faster to produce.
Kept the political banner in the README. Closes
issue 2344_... _issue 1987: #1987
.. _issue 2277: #2277
.. _issue 2293: #2293
.. _issue 2294: #2294
.. _issue 2314: #2314
.. _issue 2335: #2335
.. _issue 2338: #2338
.. _issue 2344: #2344
.. _changes_7-16-2:
v7.16.2Compare Source
Fix: on Python 3.14 and later, a
forloop completing immediately before afunction return could mistakenly report an uncovered branch. This is now
fixed, closing
issue 2168_.Fix: on Python 3.14 and later, the
elseclause of atrywhose body isa
withstatement could incorrectly be reported as covered when thewithraised. This is now fixed, closingissue 2289_.Fix: with
dynamic_context = test_function, test methods written as@staticmethodor@classmethodwere not given a context of their own.Now they are, on Python 3.11 and later. Closes
issue 1923_... _issue 1923: #1923
.. _issue 2168: #2168
.. _issue 2289: #2289
.. _changes_7-16-1:
v7.16.1Compare Source
Fix: when the body of an irrefutable
case(likecase _:) is entirelyexcluded, the
caseline is now excluded too, just as an excludedelse:body removes theelse:line. Previously thecaseline wasleft behind and reported as missing. Closes
issue 1563_ withpull 2269_.Fix: using :meth:
.CoverageData.updatetwice on an in-memory database wouldfail, as described in
issue 2279_. This is now fixed.Fix: the Total row in the footer of the HTML report's index page was
recomputed in JavaScript with rounding that could disagree with the total
the server rendered in the heading, including showing
100%when coveragewas not complete. The footer now clamps values the way the rest of the
report does, and when nothing is filtered out it is shown exactly as the
server rendered it, so the two can't disagree. That also keeps rows the
report omits (
--skip-covereddrops fully covered files) in the total.Fixes
issue 2256_... _issue 1563: #1563
.. _issue 2256: #2256
.. _pull 2269: #2269
.. _issue 2279: #2279
.. _changes_7-16-0:
v7.16.0Compare Source
When combining files, now path separator slashes will automatically be
converted to the local file system style. This makes it less necessary to
define
[paths]configuration to combine data across operating systems.Fixes
issue 2266_.The :meth:
.Coverage.switch_contextmethod now returns the previous context.Fix: previously, a
[paths]pattern would be replaced everywhere in a filepath when it was only meant to be replaced once, in the leading portion of
the path. This is now fixed, in
pull 2268_.Fixes to validation of options and configuration settings:
Negative precision settings now always cause useful error messages (
pull 2261_).An invalid regex in the
--contextsoption (or the[report] contextssetting) reported a confusing "Couldn't use data file ...:user-defined function raised exception" error. Now it raises a proper
configuration error naming the bad regex, like other regex settings do
(
pull 2262_).Non-string values in TOML configuration settings now produce a helpful
error message instead of a traceback. This affects list settings whose
elements aren't strings (like
omit,exclude_lines, or a[paths]entry), file settings like
data_file, and any wrong-typed value in the[paths]section (pull 2263_).coverage runrefuses run-affecting command-line options like--branchalongside--concurrency=multiprocessing, since they can'treach the subprocesses. The check only recognized
multiprocessingasthe entire option value, so
--concurrency=multiprocessing,threadslipped through and failed later with "Can't combine statement coverage
data with branch data". Each named concurrency library is now properly
considered (
pull 2270_).Fix:
coverage annotate -d DIRraised anAssertionErrorif anymeasured file had an extension other than
.py, such as a.pywfile onWindows. The original extension is now restored on the annotated copy (
pull 2265_)... _pull 2261: #2261
.. _pull 2262: #2262
.. _pull 2263: #2263
.. _pull 2265: #2265
.. _issue 2266: #2266
.. _pull 2268: #2268
.. _pull 2270: #2270
.. _changes_7-15-4:
v7.15.4Compare Source
Fix: in the HTML report, a source file name containing a double quote (legal
on POSIX) wasn't escaped where it's dropped into the
hrefof the indexand prev/next links, so it could close the attribute early and inject markup.
Page URLs are now escaped. Thanks,
Rajath Mohare <pull 2227_>_.Fix: the LCOV report wrote file names and other fields into its
line-oriented records without neutralizing control characters. A measured
file whose name contained a newline (legal on POSIX) could forge extra
records, inflating the coverage seen by tools that read the report. Control
characters in a field are now replaced. Thanks,
Rajath Mohare <pull 2226_>_.Wheels are now provided for Python 3.15.
.. _pull 2226: #2226
.. _pull 2227: #2227
.. _changes_7-15-3:
v7.15.3Compare Source
Fix: the sysmon core is incompatible with dynamic contexts. Previously, the
combination would be prevented when read from the coverage.py configuration.
But using the context API as pytest-cov does, contexts would be silently
dropped. Now a warning is issued, thanks to
Jisang Han <pull 2234_>.Closes
issue 2200.A performance improvement in the low-level line number bookkeeping when
combining data files, thanks to
Kevin Turcios <pull 2239_>_.Performance improvement in HTML reporting by reducing the number of times
files have to be parsed, thanks to
Kevin Turcios <pull 2240_>_... _issue 2200: #2200
.. _pull 2234: #2234
.. _pull 2239: #2239
.. _pull 2240: #2240
.. _changes_7-15-2:
v7.15.2Compare Source
increased memory use during reporting for large projects. Now we use a
different approach that is both faster and slimmer than 7.15.0. Fixes
issue 2229_... _issue 2229: #2229
.. _changes_7-15-1:
v7.15.1Compare Source
Fix: in the HTML report with
show_contextsenabled, a context labelcontaining
</script>(for example a parametrized pytest node id) couldclose the inline
<script>element in a file page early, injecting markup.Context labels are now fully escaped. Thanks,
Rajath Mohare <pull 2224_>_.A number of performance improvements thanks to Paul Kehrer, in pull requests
2213 <pull 2213_>,2214 <pull 2214_>,2215 <pull 2215_>,2216 <pull 2216_>,2218 <pull 2218_>,2220 <pull 2220_>, and2221 <pull 2221_>_... _pull 2213: #2213
.. _pull 2214: #2214
.. _pull 2215: #2215
.. _pull 2216: #2216
.. _pull 2218: #2218
.. _pull 2220: #2220
.. _pull 2221: #2221
.. _pull 2224: #2224
.. _changes_7-15-0:
v7.15.0Compare Source
Since 7.14.0, reporting commands implicitly combine parallel data files. Now
those commands have a new option
--keep-combinedto retain the data filesafter combining them instead of the default, which is to delete them.
Finishes
issue 2198_.Fix: the LCOV report would incorrectly count excluded functions as uncovered,
as described in
issue 2205. This is now fixed thanks toMartin Kuntz Jacobsen <pull 2206_>.When running your program, coverage now correctly sets
yourmodule.__spec__.loaderasstrongly recommended <--loader--_>,avoiding the deprecation warning described in
issue 2208. Thanks,A5rocks <pull 2209_>_.Fix: with Python 3.10, running with the
-I(isolated mode) option didn'tcorrectly omit the current directory from the module search path, as
described in
issue 2103. That is now fixed thanks toIlia Sorokin <pull 2211_>... --loader--: https://docs.python.org/3/reference/datamodel.html#module.__loader_
.. _issue 2103: #2103
.. _issue 2198: #2198
.. _issue 2205: #2205
.. _pull 2206: #2206
.. _issue 2208: #2208
.. _pull 2209: #2209
.. _pull 2211: #2211
.. _changes_7-14-3:
v7.14.3Compare Source
Fix: the default
...exclusion rule now also matches function bodieswhose closing return-type bracket is on its own line (for example, after a
long
-> dict[ ... ]annotation that a formatter has split over multiplelines). Closes
issue 2185, thanksMengjia Shang <pull 2196_>.Fix: On 3.13t, we incorrectly issued
Couldn't import C tracererrors.We can't import the C tracer because in 7.14.2 we stopped shipping compiled
wheels for 3.13t. Thanks,
Hugo van Kemenade <pull 2203_>_... _issue 2185: #2185
.. _pull 2196: #2196
.. _pull 2203: #2203
.. _changes_7-14-2:
v7.14.2Compare Source
Fix: some messages were being written to stdout, making
coverage json -o -useless for capturing JSON output. Now messages are written to stderr,fixing
issue 2197_.Fix:
CoverageDatakept one SQLite connection per thread that recordedcoverage, but never closed them when those threads terminated. On long runs
with many short-lived threads this leaked one file descriptor per dead
thread, eventually failing with
OSError: [Errno 24] Too many open files.Connections belonging to terminated threads are now closed and dropped.
Fixes
issue 2192. Thanks,Matthew Lloyd <pull 2193_>.Fix: when using sys.monitoring, we were assuming we could use the
COVERAGE_IDtool id. But other tools might also assume they could usethat id. Pre-allocated ids don't really make sense, so now we search for a
usable one instead. Fixes
issue 2187_.Following
the advice of cibuildwheel <no-13t_>_, we no longer distributewheels for Python 3.13 free-threaded.
.. _issue 2187: #2187
.. _issue 2192: #2192
.. _pull 2193: #2193
.. _issue 2197: #2197
.. _no-13t: https://py-free-threading.github.io/ci/#building-free-threaded-wheels-with-cibuildwheel
.. _changes_7-14-1:
v7.14.1Compare Source
Fix: the HTML report used typographic niceties to make file paths more
readable by adding a small amount of space around slashes. Those spaces
interfered with searching the page for file paths of interest. Now the report
uses CSS to accomplish the same visual tweak so that searches with slashes
work correctly. Closes
issue 2170_.Add a 3.16 PyPI classifier <hugo-316_>_ since we test on the 3.16 mainbranch.
.. _issue 2170: #2170
.. _hugo-316: https://mastodon.social/@hugovk/116588523571204490
.. _changes_7-14-0:
v7.14.0Compare Source
Feature: now when running one of the reporting commands, if there are
parallel data files that need combining, they will be implicitly combined
before creating the report. There is no option to avoid the combination; let
us know if you have a use case that requires it. Thanks,
Tim Hatch <pull 2162_>. Closesissue 1781.Fix: the output from
combinewas too verbose, listing each fileconsidered. Now it shows a single line with the counts of files combined,
files skipped, and files with errors. The
-qflag suppresses this line.The old detailed lines are available with the new
--debug=combineoption.Fix: running a Python file through a symlink now sets the sys.path correctly,
matching regular Python behavior. Fixes
issue 2157_.Fix:
Collector.flush_datacould fail with "RuntimeError: Set changedsize during iteration" when a tracer in another thread added a line to the
per-file set that
add_lines(oradd_arcs) was iterating. The valuespassed to
CoverageDataare now snapshotted viadict.copy()andset.copy(), which are atomic under the GIL. Thanks,Alex Vandiver <pull 2165_>_.Fix: the soft keyword
lazyis now bolded in HTML reports.We are no longer testing eventlet support. Eventlet started issuing stern
deprecation warnings that break our tests. Our support code is still there.
.. _issue 1781: #1781
.. _issue 2157: #2157
.. _pull 2162: #2162
.. _pull 2165: #2165
.. _changes_7-13-5:
python/mypy (mypy)
v2.4.0Compare Source
pytest-dev/pytest (pytest)
v9.2.0Compare Source
pytest 9.2.0 (2026-10-27)
Removals and backward incompatible breaking changes
#14716:
-cnow raises a usage error for a path that does not exist, is a directory, or is in a format pytest has no loader for. Such paths were previously either ignored or reported as an unhandledFileNotFoundError.#8593: The
indirect,idsandscopearguments ofMetafunc.parametrize() <pytest.Metafunc.parametrize>-- and therefore of@pytest.mark.parametrize <pytest.mark.parametrize ref>-- are now keyword-only.Passing them positionally was a common source of confusing errors, e.g.
parametrize("arg1", "arg2", [(1, 2)])made the argvalues land inindirectand failed withindirect fixture '(1, 2)' doesn't exist; such mistakes now fail with an understandableTypeError. The type annotations have always declared these arguments as keyword-only.#993: Plugin import failures at startup are now reported and classified instead of escaping as a raw traceback with the accidental exit code
1:-p,pytest_pluginsorPYTEST_PLUGINS-- exits withpytest.ExitCodeUSAGE_ERROR(4), like aconftest.pythat fails to import;pytest11entry point or a missing plugin dependency -- exits withpytest.ExitCodeINTERNAL_ERROR(3), with the traceback preserved.pytest.mainnow returns these codes instead of raisingImportError. Also fixed anIndexErrorfrom pytest's own internals when the plugin raised an exception with no arguments.Deprecations (removal in next major release)
#14742: The private
_pytest.python.CallSpec2name has been renamed toCallSpec.The old
CallSpec2alias remains available for now and will be removed in pytest 10 or 11.#14755: Schedule yield_fixture decorator for removal in pytest 10 or 11.
#14774: Similarly to the deprecation of class-scoped fixtures defined as instance methods in pytest 9.1,
all higher-scoped fixtures (
module,package, andsession) definedas instance methods are now deprecated.
They suffer from the same issue the original deprecation only fixed for
class-scoped fixtures, see
10819and14011.#14808: Passing a non-string value to a
string-typed ini option now emits apytest.PytestRemovedIn10Warning. This affects[tool.pytest.ini_options]inpyproject.toml. In pytest 10 this will raise aTypeError, matching the behavior of the corresponding TOML config path.#7323: Passing
bytestoTerminalReporter.write_line()is now deprecated, pass astrinstead.New features
strict_markersis enabled, marker names used in-mexpressions are now validated against registered markers.parametrize_long_str_id_strategyconfiguration option to control how longstr/bytesparameter values are handled in auto-generated test IDs. Explicit IDs set viaids=[...]orpytest.param(..., id=...)are not affected. Available strategies:short(default, values over 100 chars fall back toargname+index),sha256(SHA-256 hex digest),legacy(keep full value), anddisallow(error requesting explicit IDs).Improvements in existing functionality
#10745: A
RecursionErrorwhose recursion origin cannot be located now shows only thefirst and last 10 stack frames, matching what pytest already did when locating
the origin failed outright. Previously the full traceback -- often around a
thousand near-identical frames -- was rendered, which was both slow and
unreadable. Pass
--full-traceto see every frame.#10745: The line numbers of a module's statements are now computed once per traceback
instead of once per traceback entry, which noticeably speeds up rendering
failures raised from large test modules.
#11418: The cached rewritten modules in
__pycache__are now invalidated by a hash ofthe source instead of its modification time, using the checked-hash pyc format
from
552.Timestamps make the cache useless wherever source files get fresh modification
times, most notably in CI: a checkout gives every file a new mtime, so a
restored cache is discarded in full and every test module is rewritten again.
Hashing the source costs roughly 15 microseconds per file and makes the cache
survive that.
Existing timestamp based caches are ignored and rewritten once.
#12624: The
pytest_pluginsvariable and thePYTEST_PLUGINSenvironment variable now also accept entry point names of installed plugins (e.g.xdist), in addition to importable module names, matching the behavior of the-pcommand-line option.As part of this change, plugins specified by entry point name through these mechanisms are now also listed in the
plugins:line of the terminal header (12615).Based on the original implementation by Marcel Telka in
12616.#12697: Warnings emitted while importing plugins through
-p,PYTEST_PLUGINS, or entry point autoloading are now captured, filtered, and reported like other warnings.#12860: Assertion diffs for
dict.items()anddict.keys()comparisons (>=,<=,>,<,==) now show which items are missing, the same way set comparisons do.#13354:
Node.get_closest_marker <_pytest.nodes.Node.get_closest_marker>now also accepts a~pytest.MarkDecoratoras itsdefault, for exampleitem.get_closest_marker("foo", pytest.mark.foo(1)), and returns the wrapped~pytest.Mark.Previously the only way to build a
defaultwas to instantiate~pytest.Markdirectly, which is private and warns.#13369: Improved the error from
pytest.RunResult.assert_outcomeswhen a plugin changes or removes pytest's standard terminal summary, and documented how to isolate output-changing plugins.#13431: Exposed
pytest.ParameterSetas the type of the return value ofpytest.param().This can be used in type annotations and
isinstancechecks.#13564: Issue a warning when fixtures are wrapped with a decorator that prevents
correct discovery, including
@classmethodabove@pytest.fixtureand@staticmethodabove@pytest.fixture. Put@pytest.fixtureabovethose decorators on test classes.
#14164: Exposed
pytest.Approxas the type of the return value ofpytest.approx().This can be used in type annotations and
isinstancechecks.#14463: Assertion diffs for mappings now match up keys the way the compared mappings match them themselves.
Key comparison goes through the mappings' key views instead of plain sets of their keys, so a mapping
with its own notion of key equivalence, such as case-insensitive header mappings, no longer
reports its common keys as missing on either side.
#14523: Large assertion comparison diffs are now built lazily and capped to the
truncation budget, so a huge diff is no longer formatted in full just to
be truncated. As a consequence, the truncation footer no longer
reports the exact number of hidden lines.
#14687: The default fd-level output capturing (
--capture=fd) now skips reading the capture buffer for tests which produce no output, reducing per-test overhead in large test suites.#14724:
--no-summarynow only applies directly to pytest's own summary.The flag no longer skips the
pytest_terminal_summaryhook, so third-partyplugins (for example coverage) can still write their terminal summaries.
#14751:
parser.addini <pytest.Parser.addini>now also accepts type expressions for itstypeargument, in addition to the existing string tags: the plain Python typesstr,bool,int,float, aLiteralof strings, and unions of these (for exampleint | strorint | Literal["auto"]).#14754:
pytest.approx()now rejects infinite relative tolerances fordatetime.timedeltavalues with a clearValueErrorinstead of raisingOverflowError.#14791: The
junit_family,junit_logging,junit_duration_report,console_output_style,empty_parameter_set_mark,assertion_text_diff_styleandtmp_path_retention_policyconfiguration options are now registered with the set of values they accept: an invalid value now fails with a clean usage error instead of being silently ignored or crashing later, andpytest --helplists the accepted values.config.getini <pytest.Config.getini>now raisespytest.UsageErrorinstead ofTypeErrororValueErrorwhen the value read from the configuration file does not match the registered type, so a bad value is always reported as a short usage error message instead of an internal error traceback. Asking for an option name that was never registered still raisesValueError.#15006:
pytest.approxnow emitspytest.PytestApproxDecimalToleranceWarningwhen arelorabstolerance is given as afloatthat cannot be represented exactly for a~decimal.Decimalcomparison, since such a tolerance is widened to the float's exact binary value.#14675, #14953, #15153, #15132: The
truncation_limit_lines,truncation_limit_chars,max_warnings,verbosity_assertions,verbosity_test_cases,verbosity_subtests,tmp_path_retention_count,log_level,log_cli_level,log_file_level,log_auto_indentandfaulthandler_timeoutconfiguration options now accept native integer (and, forlog_auto_indent, boolean) values in TOML configuration files, while still accepting strings for backward compatibility.log_file_modenow reports invalid values as a usage error.#15254:
tmp_pathandTempPathFactory.mktemp <pytest.TempPathFactory.mktemp>no longer list the whole base temporary directory on every call, which made sessions with many temporary directories quadratically slow. Numbers are now handed out from a per-prefix counter, skipping names that already exist.#4569:
Node.add_marker <_pytest.nodes.Node.add_marker>now stores a~pytest.Markinnode.keywords, matching what marks applied during collection store. Previously it stored a~pytest.MarkDecorator.#9436: Avoided formatting tracebacks for tests marked with
xfail(run=False).Bug fixes
#10128: Configured warning filters now apply to warnings emitted by
pytest_configurehooks.#10210:
pytest.approxnow raises aTypeErrorfor any nested container, notonly for one of the same type as its parent. Previously
approx([{"k": 1}])and
approx({"k": [1]})were accepted and then compared unequal to everyvalue, silently ignoring the tolerance, while
approx([[1]])correctlyreported that nesting is unsupported.
#10644:
monkeypatch.setattr()no longer leaves a new entry in the instance__dict__when it patches an attribute that the instance inherits from its class.Previously
undo()assigned the inherited value onto the instance, which shadowed the class attribute -- permanently freezing the result for descriptors that resolve dynamically.#1139: Fixed tracebacks showing
???instead of source lines for code compiled with a filename relative to a directory other than the current working directory -- e.g. compiled Cython modules, when running pytest from a subdirectory of the project root.The source lookup now falls back to searching
sys.pathfor such filenames, as the standardtracebackmodule does.#11502: The
rootdiris no longer derived from a configuration file that is not a regular file, such as--config-file=/dev/null.#11783: Plugins installed in editable mode (
660) are marked for assertion rewriting again.Such installs do not record the package's Python files in the distribution metadata, so pytest found nothing to rewrite and assertions inside the plugin lost their introspection. The plugin's entry point is now used to locate the package in that case.
#11933:
pytest.warnsno longer re-emits unmatched warnings withmodule="warnings", which causedmodule-based warning filters to be applied to the wrong warnings. Sincewarnings.WarningMessagedoes not record the module a warning was emitted with, re-emitted warnings now use the standardwarnings.warn_explicitdefault of deriving the module from the warning's filename.#12175:
ExceptionInfo.exconly(tryshort=True) <pytest.ExceptionInfo.exconly>now strips theAssertionError:prefix of failedassertstatements for~pytest.ExceptionInfoobjects created bypytest.raises, and failures insideunittest.TestCase.subTestreport the same short crash line as regular tests.#12223: The
messageattribute of<failure>and<error>elements in--junitxmlreports is now shortened to whole lines within 500 characters. When something is dropped, it ends with a note pointing to the element text, which still holds the full report. Previously, very verbose assertion output (e.g. with-vv) produced attributes tens of thousands of characters long, which some XML parsers fail on.#12307: Fixed truncation of long collections (lists, dicts, sets, etc.) in the "message" part of failed assertions (as in
assert condition, msg) when using-vv: the message now uses the same unlimited repr as the rest of the assertion output, instead of eliding collection elements with....#12824: Custom command-line options now fail with a clear error when their implicit
destination conflicts with an existing option, avoiding silent overrides of
built-in options such as
-k.#13292: Fixed a stale rewritten module being used when a test file is modified twice
within the same second without changing its size -- the pyc header could only
record whole-second timestamps. The cache is now keyed on a hash of the source.
#14036:
__tracebackhide__is now respected inExceptionGrouptracebacks, both for the group itself and for its sub-exceptions.#14189: Nested usage of
caplog.filtering <pytest.LogCaptureFixture.filtering>no longer removes filters early if they were already present.#14412: Fixed incorrect timing information for subtests and parent tests when
console_output_style = "times".#14445: Assertion rewriting no longer evaluates walrus operator (
:=) expressions more than once, which reported results the test never computed when the expression had side effects.An operand evaluated before a later walrus is now reported with the value it actually saw, so
assert value != identity(value := value.lower())keeps Python's left-to-right order.#14552: Fixed stale
co_filenamevalues after a test module or directory is moved. Assertion-rewrite caches are reused when the source hash still matches, and in-memory code objects are pointed at the current path.#14586: Negative values passed to
log_auto_indentnow correctly fall back to no indentation, matching the documented behavior.#14619: Fixed a crash in
pytest.mark.parametrizewhen a non-sequence value is passed for a parameter set. It now provides a clear error message during collection.#14635: Fixed fixture resolution failures when specifying multiple test paths on the command line that share common parent directories. Parametrized fixtures defined in a
conftest.pycould be silently dropped depending on the order of the specified paths.#14637: Pytest now correctly skips identical trailing characters in assertion text diffs even when the compared strings differ at the beginning.
#14638: Top-level options in
pytest.tomland.pytest.tomlfiles now raise an error instead of being silently ignored when no[pytest]table is present.#14683: Fixed a regression in pytest 9.1 where a conftest.py located in the rootdir was no longer visible to tests and doctests collected from outside the rootdir (for example when passing a parent directory of the rootdir as a collection argument, or setting
--rootdirto a subdirectory).As a result, fixtures defined in such a conftest -- including
doctest_namespaceinjections -- were not available, causing errors such asNameErrorin doctests.#14700: Fixed an internal error on Python 3.12 when a doctest on a fixture-decorated function was skipped.
#14705: TOML configuration files passed via
-cnow also read their configuration from the[pytest]table, the one pytest's own configuration files use. The[tool.pytest]and[tool.pytest.ini_options]tables such files were previously restricted to keep working; using both styles in one file is an error.#14828: Exception groups raised from another exception now print their cause chain only once in the traceback output.
#14864: Fixed collection on Windows collecting the whole suite instead of the given path, on file systems which do not support file IDs (
st_inois0for every file, as seen for example onsshfs-win/WinFsp mounts).#14884:
Cache.get(),Cache.set()andCache.mkdir()now reject keys that resolve outside the cache directory, and--cache-showignores glob matches outside it.#14909: Fixed
MonkeyPatch.delattr <pytest.MonkeyPatch.delattr>,MonkeyPatch.setitem <pytest.MonkeyPatch.setitem>andMonkeyPatch.delitem <pytest.MonkeyPatch.delitem>recording a stale undo entry when the underlying mutation failed, which could cause spurious errors during teardown. The undo entry is now recorded only after the mutation succeeds, matching the behavior ofMonkeyPatch.setattr <pytest.MonkeyPatch.setattr>.#14912:
~pytest.PytestWarninginstances defined in_pytest.deprecatedare no longer reused acrosswarnings.warncalls, so warnings raised as errors (e.g. with-W error) no longer accumulate stale traceback frames from previous raises.#14942: Fixed a regression in 9.1.0 that made collection very slow (quadratic) when many fixtures are defined with the same name.
This can happen particularly when many tests are defined in separate classes which inherit from a base class which defines fixtures (the fixtures are repeated per class).
#15005:
pytest.approxno longer treats finite~decimal.Decimalvalues outside thefloatrange (such asDecimal("1e400")) as infinite, which made in-tolerance comparisons fail.#15006: Restored the tolerance shown by
pytest.approxfor~decimal.Decimalvalues, which since 9.0 displayed???for the default tolerance and reported the rawrelratio instead of the absolute tolerance actually compared against.#15006: The failure message for
pytest.approxcomparisons of~decimal.Decimalcollections no longer reportsMax absolute difference: -inf, or crashes for mappings, when thedecimal.FloatOperationtrap is set.#15006:
pytest.approxno longer raisesAttributeErrorwhen comparingnumpy.ndarrayinstances withobjectdtype, such as arrays of~decimal.Decimal.#15032: Help texts for command-line options and configuration options now keep their indentation
and blank lines. Previously each line was stripped before wrapping, so a wrapped
list item was indistinguishable from a new one and blank lines were dropped; configuration
option help lost its line breaks entirely.
#15043: Cache writes now emit
pytest.PytestCacheWarningwhen writing or closing the cache file fails, consistent with errors opening the file.#15052: Fixed possible off-by-one line numbers in
--fixturesand--fixtures-per-testoutput.#15145: With
console_output_styleset totimes, durations just below a unit boundary are now shown in the next unit (e.g.1.000msinstead of1000.0us).#15172: Assertion diffs now pretty-print the built-in
frozendict(Python 3.15+) across multiple lines, similarly to howdictis displayed.#4569:
-kno longer matches attributes that end up in a test function's__dict__without being meant as keywords, such as pytest's ownpytestmarkattribute and the bookkeeping left behind byfunctools.wrapsandfunctools.lru_cache.#6750: Fix fixture argument discovery for custom collectors that pass bound methods to
pytest.Function.#6997: XFAIL reports from teardown phases now include the phase in the short test
summary.
#7940: Fixed cleanup of temporary directories failing when subdirectories have their execute permission removed.
#8321: Fixed exception chains being duplicated in the traceback output when an exception in the chain (
__cause__/__context__) has no traceback of its own, and that exception is itself linked to further exceptions.#8914: Tests parametrized with higher-than-function scope are now reordered by
parameter value rather than by parameter index, so that items using equal
parameter values are grouped together and share a single fixture setup, even
when they are parametrized by separate
@pytest.mark.parametrize <pytest.mark.parametrize ref>calls. Previously, an expensive higher-scoped fixture could be set up and torn
down repeatedly for the same parameter value.
Unhashable parameter values (e.g. dicts) keep the previous index-based
grouping behavior.
As a consequence, the order in which parametrized tests run may change
(fixture setup/teardown counts can only decrease, not increase).
#9924: Fixed doctest option flags leaking between docstrings after a failure, skip, or expected failure.
Improved documentation
setup.pyusage withpyproject.tomlinwriting-plugins.--confcutdiraffects initialconftest.pydiscovery.pytest-flakefightersplugin to the list of flaky test plugins inplugins.rst.Added flaky test papers published on the Test FLARE project to the list of flaky papers in
plugins.rst.installation instructions <installation>andinstall-package-with-pipnow show how to install pytest into a virtual environment with venv and pip, uv or virtualenv, and explain theexternally-managed-environmenterror.pytest --help, the-kreference entry andselect-testsno longer describe-kas a Python expression matched against test names only;keyword expressionsnow shows marker names being matched as well. The examples that looked up a marker useNode.get_closest_marker <_pytest.nodes.Node.get_closest_marker>rather thanitem.keywords.session.itemsandsession.testscollectedexclude deselected tests in thepytest_collectiondocumentation.Packaging updates and notes for downstreams
#11680: Source archives of arbitrary commits -- the tarballs GitHub serves under
/archive/, not just the ones for tags -- can now be built into an sdist or awheel with a correct version. A
.git_archival.txtfile, expanded bygit archiveviaexport-subst, carries the describe output thatsetuptools-scmwould otherwise have to askgitfor.The archival file deliberately omits
ref-names. Recording it would make thecontent of an archive -- and therefore its checksum -- change whenever a branch
that points at the archived commit is moved afterwards, which is how the
equivalent tarballs of tagged releases became unstable for other projects.
Describe output alone depends only on the commit and on the tags reachable from
it.
The archival file is not shipped in the sdist -- an sdist carries its version
in its metadata, and the template is only ever expanded by
git archive.Building pytest from a git checkout now requires
setuptools-scm >= 10.1.#9236:
pluggy>=1.6is now required.Older pluggy versions stopped running the remaining hook wrapper teardowns once an
old-style
hookwrapperraised in its own teardown. The logging plugin's wrapper wasleft suspended, and when it was finalised later it detached the handler that
caplogof a subsequent test was recording through, so that test saw no records.Contributor-facing changes
DistFacadecompatibility class.Miscellaneous internal changes
FixtureRequest.node <pytest.FixtureRequest.node>is now explicitly annotated as returningAny, so strict pyright no lonConfiguration
📅 Schedule: (in timezone Europe/Stockholm)
* * * * 1)🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.