#7132: Added two environment variables PYTEST_THEME and PYTEST_THEME_MODE to let the users customize the pygments theme used. In a class hierarchy, tests from base classes are now consistently ordered before tests defined on their subclasses (reverse MRO order). #5196: Tests are now ordered by definition order in more cases. There was no deprecation period for this change (sorry!). The path property of _ returns Path instead of py.path.local. #8174: The following changes have been made to types reachable through : This was changed for consistency with and which both accept Using msg still works, but is deprecated and will be removed in a future release. Signatures now accept a reason argument instead of msg.
CRITICAL OPS HACK 4.0.1 CODE
It to mean “this code does not emit warnings”, but it actually had the effect ofĬhecking that the code emits at least one warning of any type - like pytest.warns() #8645: pytest.warns(None) is now deprecated because many people used Use pytest_load_initial_conftests instead. #8592: pytest_cmdline_preparse has been officially deprecated.
CRITICAL OPS HACK 4.0.1 FULL
See the deprecation note for full details. It was never sanely supported and triggers hard to debug errors. #8447: Defining a custom pytest node type which is both an pytest.Item and a pytest.Collector (e.g. Parser.addoption(., type="int/string/float/complex") - use type=int etc. Scheduled for removal in pytest 8 (deprecated since pytest 2.4.0): #8315: Several behaviors of Parser.addoption are now This deprecation has been reverted in pytest 7.1.0. Unittest.skip() in unittest test cases is fully supported. Note: This deprecation only relates to using unittest.SkipTest during testĬollection. #8242: Raising unittest.SkipTest to skip collection of tests during the These constructors have always been considered private, but now issue a deprecation warning, which may become a hard error in pytest 8. #7469: Directly constructing the following classes is now deprecated: Resolved in future versions as we slowly get rid of the pyĭependency (see issue #9283 for a longer discussion). This is an unfortunate artifact due to historical reasons, which should be New attribute being path) is the opposite of the situation for hooks The name of the Node arguments and attributes (the It is apparently common for users to mistakenly use pytest.approx like this: #9061: Using pytest.approx() in a boolean context now raises an error hinting at the proper usage. Warnings, and will stop working on Python 3.10.
Pyreadline seems to have gone unmaintained, is generating The workaround was introduced in #1281 in 2015, however since then #8733: Drop a workaround for pyreadline that made it work with -pdb. #8246: -version now writes version information to stdout rather than stderr. Note: pytest was not able to provide a deprecation period for this change. Plugins and users which call reportinfo(), use the first return value and interact with it as a py.path.local, would need to adjust by calling py.path.local(fspath).Īlthough preferably, avoid the legacy py.path.local and use pathlib.Path, or use item.location or item.path, instead. Since py.path.local is a os.PathLike, these plugins are unaffacted. Most plugins which refer to reportinfo() only define it as part of a custom pytest.Item implementation. #7259: The Node.reportinfo() function first return value type has been expanded from py.path.local | str to os.PathLike | str. Note that this implies that custom classes which only implement _iter_ and _len_ are no longer supported as they don’t guarantee order. #9692: pytest.approx() now raises a TypeError when given an unordered sequence (such as set). Now bytes, complex, re.Pattern, Enum and anything with a _name_ are also accepted. #9678: More types are now accepted in the ids argument to only str, float, int and bool were accepted See Resource Warnings for more information. #9644: More information about the location of resources that led Python to raise ResourceWarning can now #9536: When -vv is given on command line, show skipping and xfail reasons in full instead of truncating them to fit the terminal width. #9362: pytest now avoids specialized assert formatting when it is detected that the default _eq_ is overridden in attrs or dataclasses. #5192: Fixed test output for some data types where -v would show less information.Īlso, when showing diffs for sequences, -q would produce full diffs instead of the expected diff.