2013-12-11 19:12:01 +08:00
|
|
|
pytest-2.5.0: now down to ZERO reported bugs!
|
|
|
|
===========================================================================
|
|
|
|
|
|
|
|
pytest-2.5.0 is a big fixing release, the result of two community bug
|
|
|
|
fixing days plus numerous additional works from many people and
|
|
|
|
reporters. The release should be fully compatible to 2.4.2, existing
|
2018-05-18 16:19:46 +08:00
|
|
|
plugins and test suites. We aim at maintaining this level of ZERO reported
|
2013-12-11 19:12:01 +08:00
|
|
|
bugs because it's no fun if your testing tool has bugs, is it? Under a
|
|
|
|
condition, though: when submitting a bug report please provide
|
|
|
|
clear information about the circumstances and a simple example which
|
|
|
|
reproduces the problem.
|
|
|
|
|
|
|
|
The issue tracker is of course not empty now. We have many remaining
|
2021-12-27 20:23:15 +08:00
|
|
|
"enhancement" issues which we'll hopefully can tackle in 2014 with your
|
2013-12-11 19:12:01 +08:00
|
|
|
help.
|
|
|
|
|
|
|
|
For those who use older Python versions, please note that pytest is not
|
|
|
|
automatically tested on python2.5 due to virtualenv, setuptools and tox
|
|
|
|
not supporting it anymore. Manual verification shows that it mostly
|
2018-05-18 16:19:46 +08:00
|
|
|
works fine but it's not going to be part of the automated release
|
2013-12-11 19:12:01 +08:00
|
|
|
process and thus likely to break in the future.
|
|
|
|
|
2018-05-18 16:19:46 +08:00
|
|
|
As usual, current docs are at
|
2013-12-11 19:12:01 +08:00
|
|
|
|
2018-05-18 16:19:46 +08:00
|
|
|
http://pytest.org
|
2013-12-11 19:12:01 +08:00
|
|
|
|
|
|
|
and you can upgrade from pypi via::
|
|
|
|
|
|
|
|
pip install -U pytest
|
|
|
|
|
|
|
|
Particular thanks for helping with this release go to Anatoly Bubenkoff,
|
|
|
|
Floris Bruynooghe, Marc Abramowitz, Ralph Schmitt, Ronny Pfannschmidt,
|
|
|
|
Donald Stufft, James Lan, Rob Dennis, Jason R. Coombs, Mathieu Agopian,
|
|
|
|
Virgil Dupras, Bruno Oliveira, Alex Gaynor and others.
|
|
|
|
|
|
|
|
have fun,
|
|
|
|
holger krekel
|
|
|
|
|
|
|
|
|
|
|
|
2.5.0
|
|
|
|
-----------------------------------
|
|
|
|
|
2018-05-18 16:19:46 +08:00
|
|
|
- dropped python2.5 from automated release testing of pytest itself
|
|
|
|
which means it's probably going to break soon (but still works
|
2013-12-11 19:12:01 +08:00
|
|
|
with this release we believe).
|
|
|
|
|
|
|
|
- simplified and fixed implementation for calling finalizers when
|
2018-05-18 16:19:46 +08:00
|
|
|
parametrized fixtures or function arguments are involved. finalization
|
2013-12-11 19:12:01 +08:00
|
|
|
is now performed lazily at setup time instead of in the "teardown phase".
|
2018-05-18 16:19:46 +08:00
|
|
|
While this might sound odd at first, it helps to ensure that we are
|
2013-12-11 19:12:01 +08:00
|
|
|
correctly handling setup/teardown even in complex code. User-level code
|
|
|
|
should not be affected unless it's implementing the pytest_runtest_teardown
|
|
|
|
hook and expecting certain fixture instances are torn down within (very
|
|
|
|
unlikely and would have been unreliable anyway).
|
|
|
|
|
2018-05-18 16:19:46 +08:00
|
|
|
- PR90: add --color=yes|no|auto option to force terminal coloring
|
2013-12-11 19:12:01 +08:00
|
|
|
mode ("auto" is default). Thanks Marc Abramowitz.
|
|
|
|
|
|
|
|
- fix issue319 - correctly show unicode in assertion errors. Many
|
|
|
|
thanks to Floris Bruynooghe for the complete PR. Also means
|
|
|
|
we depend on py>=1.4.19 now.
|
|
|
|
|
2018-05-18 16:19:46 +08:00
|
|
|
- fix issue396 - correctly sort and finalize class-scoped parametrized
|
|
|
|
tests independently from number of methods on the class.
|
2013-12-11 19:12:01 +08:00
|
|
|
|
|
|
|
- refix issue323 in a better way -- parametrization should now never
|
|
|
|
cause Runtime Recursion errors because the underlying algorithm
|
|
|
|
for re-ordering tests per-scope/per-fixture is not recursive
|
|
|
|
anymore (it was tail-call recursive before which could lead
|
|
|
|
to problems for more than >966 non-function scoped parameters).
|
|
|
|
|
|
|
|
- fix issue290 - there is preliminary support now for parametrizing
|
2018-05-18 16:19:46 +08:00
|
|
|
with repeated same values (sometimes useful to test if calling
|
2013-12-11 19:12:01 +08:00
|
|
|
a second time works as with the first time).
|
|
|
|
|
|
|
|
- close issue240 - document precisely how pytest module importing
|
2018-05-18 16:19:46 +08:00
|
|
|
works, discuss the two common test directory layouts, and how it
|
2013-12-11 19:12:01 +08:00
|
|
|
interacts with PEP420-namespace packages.
|
|
|
|
|
|
|
|
- fix issue246 fix finalizer order to be LIFO on independent fixtures
|
2018-05-18 16:19:46 +08:00
|
|
|
depending on a parametrized higher-than-function scoped fixture.
|
2013-12-11 19:12:01 +08:00
|
|
|
(was quite some effort so please bear with the complexity of this sentence :)
|
|
|
|
Thanks Ralph Schmitt for the precise failure example.
|
2018-05-18 16:19:46 +08:00
|
|
|
|
2013-12-11 19:12:01 +08:00
|
|
|
- fix issue244 by implementing special index for parameters to only use
|
|
|
|
indices for paramentrized test ids
|
|
|
|
|
|
|
|
- fix issue287 by running all finalizers but saving the exception
|
|
|
|
from the first failing finalizer and re-raising it so teardown will
|
|
|
|
still have failed. We reraise the first failing exception because
|
|
|
|
it might be the cause for other finalizers to fail.
|
|
|
|
|
|
|
|
- fix ordering when mock.patch or other standard decorator-wrappings
|
2019-12-19 17:35:15 +08:00
|
|
|
are used with test methods. This fixes issue346 and should
|
2013-12-11 19:12:01 +08:00
|
|
|
help with random "xdist" collection failures. Thanks to
|
|
|
|
Ronny Pfannschmidt and Donald Stufft for helping to isolate it.
|
|
|
|
|
|
|
|
- fix issue357 - special case "-k" expressions to allow for
|
|
|
|
filtering with simple strings that are not valid python expressions.
|
|
|
|
Examples: "-k 1.3" matches all tests parametrized with 1.3.
|
|
|
|
"-k None" filters all tests that have "None" in their name
|
2018-05-18 16:19:46 +08:00
|
|
|
and conversely "-k 'not None'".
|
2013-12-11 19:12:01 +08:00
|
|
|
Previously these examples would raise syntax errors.
|
2018-05-18 16:19:46 +08:00
|
|
|
|
2013-12-11 19:12:01 +08:00
|
|
|
- fix issue384 by removing the trial support code
|
|
|
|
since the unittest compat enhancements allow
|
|
|
|
trial to handle it on its own
|
|
|
|
|
|
|
|
- don't hide an ImportError when importing a plugin produces one.
|
|
|
|
fixes issue375.
|
|
|
|
|
2018-05-18 16:19:46 +08:00
|
|
|
- fix issue275 - allow usefixtures and autouse fixtures
|
2013-12-11 19:12:01 +08:00
|
|
|
for running doctest text files.
|
|
|
|
|
|
|
|
- fix issue380 by making --resultlog only rely on longrepr instead
|
|
|
|
of the "reprcrash" attribute which only exists sometimes.
|
|
|
|
|
|
|
|
- address issue122: allow @pytest.fixture(params=iterator) by exploding
|
|
|
|
into a list early on.
|
|
|
|
|
|
|
|
- fix pexpect-3.0 compatibility for pytest's own tests.
|
|
|
|
(fixes issue386)
|
|
|
|
|
|
|
|
- allow nested parametrize-value markers, thanks James Lan for the PR.
|
|
|
|
|
|
|
|
- fix unicode handling with new monkeypatch.setattr(import_path, value)
|
|
|
|
API. Thanks Rob Dennis. Fixes issue371.
|
|
|
|
|
|
|
|
- fix unicode handling with junitxml, fixes issue368.
|
|
|
|
|
|
|
|
- In assertion rewriting mode on Python 2, fix the detection of coding
|
|
|
|
cookies. See issue #330.
|
|
|
|
|
|
|
|
- make "--runxfail" turn imperative pytest.xfail calls into no ops
|
|
|
|
(it already did neutralize pytest.mark.xfail markers)
|
|
|
|
|
|
|
|
- refine pytest / pkg_resources interactions: The AssertionRewritingHook
|
2018-05-18 16:19:46 +08:00
|
|
|
PEP302 compliant loader now registers itself with setuptools/pkg_resources
|
2013-12-11 19:12:01 +08:00
|
|
|
properly so that the pkg_resources.resource_stream method works properly.
|
|
|
|
Fixes issue366. Thanks for the investigations and full PR to Jason R. Coombs.
|
|
|
|
|
|
|
|
- pytestconfig fixture is now session-scoped as it is the same object during the
|
2018-05-18 16:19:46 +08:00
|
|
|
whole test run. Fixes issue370.
|
2013-12-11 19:12:01 +08:00
|
|
|
|
|
|
|
- avoid one surprising case of marker malfunction/confusion::
|
2018-05-18 16:19:46 +08:00
|
|
|
|
2013-12-11 19:12:01 +08:00
|
|
|
@pytest.mark.some(lambda arg: ...)
|
|
|
|
def test_function():
|
|
|
|
|
2018-05-18 16:19:46 +08:00
|
|
|
would not work correctly because pytest assumes @pytest.mark.some
|
|
|
|
gets a function to be decorated already. We now at least detect if this
|
2017-01-01 01:54:47 +08:00
|
|
|
arg is a lambda and thus the example will work. Thanks Alex Gaynor
|
2013-12-11 19:12:01 +08:00
|
|
|
for bringing it up.
|
|
|
|
|
|
|
|
- xfail a test on pypy that checks wrong encoding/ascii (pypy does
|
|
|
|
not error out). fixes issue385.
|
|
|
|
|
|
|
|
- internally make varnames() deal with classes's __init__,
|
|
|
|
although it's not needed by pytest itself atm. Also
|
|
|
|
fix caching. Fixes issue376.
|
|
|
|
|
2018-05-18 16:19:46 +08:00
|
|
|
- fix issue221 - handle importing of namespace-package with no
|
2013-12-11 19:12:01 +08:00
|
|
|
__init__.py properly.
|
|
|
|
|
|
|
|
- refactor internal FixtureRequest handling to avoid monkeypatching.
|
2018-05-18 16:19:46 +08:00
|
|
|
One of the positive user-facing effects is that the "request" object
|
2013-12-11 19:12:01 +08:00
|
|
|
can now be used in closures.
|
|
|
|
|
|
|
|
- fixed version comparison in pytest.importskip(modname, minverstring)
|
|
|
|
|
|
|
|
- fix issue377 by clarifying in the nose-compat docs that pytest
|
|
|
|
does not duplicate the unittest-API into the "plain" namespace.
|
|
|
|
|
|
|
|
- fix verbose reporting for @mock'd test functions
|