2011-11-19 00:01:29 +08:00
|
|
|
py.test 2.2.0: test marking++, parametrization++ and duration profiling
|
2011-11-09 01:20:56 +08:00
|
|
|
===========================================================================
|
|
|
|
|
2011-11-19 00:01:29 +08:00
|
|
|
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:
|
2011-11-12 23:10:12 +08:00
|
|
|
|
2011-11-17 19:09:21 +08:00
|
|
|
* "--duration=N" option showing the N slowest test execution
|
2011-11-12 23:10:12 +08:00
|
|
|
or setup/teardown calls.
|
|
|
|
|
2011-11-17 19:09:21 +08:00
|
|
|
* @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.
|
2011-11-12 23:10:12 +08:00
|
|
|
|
2011-11-17 19:09:21 +08:00
|
|
|
* "-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.
|
2011-11-12 23:10:12 +08:00
|
|
|
|
2011-11-19 00:01:29 +08:00
|
|
|
* 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.
|
|
|
|
|
2011-11-17 19:09:21 +08:00
|
|
|
Usage of improved parametrize is documented in examples at
|
|
|
|
http://pytest.org/latest/example/parametrize.html
|
2011-11-19 00:01:29 +08:00
|
|
|
|
2011-11-12 23:10:12 +08:00
|
|
|
Usages of the improved marking mechanism is illustrated by a couple
|
2011-11-17 19:09:21 +08:00
|
|
|
of initial examples, see http://pytest.org/latest/example/markers.html
|
2011-11-12 23:10:12 +08:00
|
|
|
|
|
|
|
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.
|
2011-11-09 01:20:56 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2011-11-17 19:09:21 +08:00
|
|
|
Thanks to Ronny Pfannschmidt, David Burns, Jeff Donner, Daniel Nouri, XXX for their
|
|
|
|
help and feedback on various issues.
|
|
|
|
|
|
|
|
best,
|
|
|
|
holger krekel
|
|
|
|
|
2011-11-12 23:10:12 +08:00
|
|
|
|
2011-11-19 00:01:29 +08:00
|
|
|
notes on incompatibility
|
2011-11-17 19:09:21 +08:00
|
|
|
------------------------------
|
2011-11-09 01:53:46 +08:00
|
|
|
|
2011-11-19 00:01:29 +08:00
|
|
|
While test suites should work unchanged you might need to upgrade plugins:
|
|
|
|
|
2011-11-09 01:53:46 +08:00
|
|
|
* You need a new version of the pytest-xdist plugin (1.7) for distributing
|
|
|
|
test runs.
|
|
|
|
|
2011-11-12 23:10:12 +08:00
|
|
|
* Other plugins might need an upgrade if they implement
|
2011-11-09 01:53:46 +08:00
|
|
|
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.
|
|
|
|
|