test_ok1/doc/announce/release-2.2.0.txt

63 lines
2.3 KiB
Plaintext
Raw Normal View History

py.test 2.2.0: test marking++, parametrization++ and duration profiling
===========================================================================
pytest-2.2.0 is a test-suite compatible release of the popular
py.test testing tool. There are a couple of new features and improvements:
* "--duration=N" option showing the N slowest test execution
or setup/teardown calls.
* @pytest.mark.parametrize decorator for runnin test functions
with multiple values and a new more powerful metafunc.parametrize()
helper to be used from pytest_generate_tests. Multiple parametrize
functions can now be invoked for the same test function.
* "-m markexpr" option for selecting tests according to their mark and
a new "markers" ini-variable for registering test markers. The new "--strict"
option will bail out with an error if you are using unregistered markers.
* teardown functions are now more eagerly called so that they appear
more directly connected to the last test item that needed a particular
fixture/setup.
Usage of improved parametrize is documented in examples at
http://pytest.org/latest/example/parametrize.html
Usages of the improved marking mechanism is illustrated by a couple
of initial examples, see http://pytest.org/latest/example/markers.html
Besides there is the usual set of bug fixes along with a cleanup of
pytest's own test suite allowing it to run on a wider range of environments.
For general information, see extensive docs with examples here:
http://pytest.org/
If you want to install or upgrade pytest you might just type::
pip install -U pytest # or
easy_install -U pytest
Thanks to Ronny Pfannschmidt, David Burns, Jeff Donner, Daniel Nouri, XXX for their
help and feedback on various issues.
best,
holger krekel
notes on incompatibility
------------------------------
While test suites should work unchanged you might need to upgrade plugins:
* You need a new version of the pytest-xdist plugin (1.7) for distributing
test runs.
* Other plugins might need an upgrade if they implement
the ``pytest_runtest_logreport`` hook which now is called unconditionally
for the setup/teardown fixture phases of a test. You can just choose to
ignore them by inserting "if rep.when != 'call': return". Note that
most code probably "just" works because the hook was already called
for failing setup/teardown phases of a test.