pytest is a mature Python testing tool with more than 1100 tests against itself, passing on many different interpreters and platforms.
See below for the changes and see docs at:
As usual, you can upgrade from pypi via:
pip install -U pytest
Thanks to all who contributed to this release, among them:
Anatoly Bubenkov Bruno Oliveira Buck Golemon David Vierra Florian Bruhin Galaczi Endre Georgy Dyuldin Lukas Bednar Luke Murphy Marcin Biernat Matt Williams Michael Aquilina Raphael Pierzina Ronny Pfannschmidt Ryan Wooden Tiemo Kieft TomV holger krekel jab
Happy testing, The py.test Development Team
2.9.0 (compared to 2.8.7)¶
-rPreporting options give the summary and full output of passing tests, respectively. Thanks to @codewarrior0 for the PR.
pytest.mark.xfailnow has a
strictoption which makes
XPASStests to fail the test suite, defaulting to
False. There’s also a
xfail_strictini option that can be used to configure it project-wise. Thanks @rabbbit for the request and @nicoddemus for the PR (issue #1355).
Parser.addininow supports options of type
bool. Thanks @nicoddemus for the PR.
catch IndexError exceptions when getting exception source location. This fixes pytest internal error for dynamically generated code (fixtures and tests) where source lines are fake by intention
Important: py.code has been merged into the
pytest._code. This decision was made because
py.codehad very few uses outside
pytestand the fact that it was in a different repository made it difficult to fix bugs on its code in a timely manner. The team hopes with this to be able to better refactor out and improve that code. This change shouldn’t affect users, but it is useful to let users aware if they encounter any strange behavior.
Keep in mind that the code for
pytest._codeis private and experimental, so you definitely should not import it explicitly!
Please note that the original
py.codeis still available in pylib.
pytest_enter_pdbnow optionally receives the pytest config object. Thanks @nicoddemus for the PR.
Comparisons now always show up in full when
BUILD_NUMBERis found in the environment, even when -vv isn’t used. Thanks @The-Compiler for the PR.
--ffnow support long names:
--failed-firstrespectively. Thanks @MichaelAquilina for the PR.
Added expected exceptions to pytest.raises fail message
Collection only displays progress (“collecting X items”) when in a terminal. This avoids cluttering the output when using
--color=yesto obtain colors in CI integrations systems (issue #1397).
Fix (issue #1422): junit record_xml_property doesn’t allow multiple records with same name.