| 1 |
pytest-2.5.0: now down to ZERO reported bugs! |
| 2 |
=========================================================================== |
| 3 |
|
| 4 |
pytest-2.5.0 is a big fixing release, the result of two community bug |
| 5 |
fixing days plus numerous additional works from many people and |
| 6 |
reporters. The release should be fully compatible to 2.4.2, existing |
| 7 |
plugins and test suites. We aim at maintaining this level of ZERO reported |
| 8 |
bugs because it's no fun if your testing tool has bugs, is it? Under a |
| 9 |
condition, though: when submitting a bug report please provide |
| 10 |
clear information about the circumstances and a simple example which |
| 11 |
reproduces the problem. |
| 12 |
|
| 13 |
The issue tracker is of course not empty now. We have many remaining |
| 14 |
"enhancement" issues which we'll hopefully can tackle in 2014 with your |
| 15 |
help. |
| 16 |
|
| 17 |
For those who use older Python versions, please note that pytest is not |
| 18 |
automatically tested on python2.5 due to virtualenv, setuptools and tox |
| 19 |
not supporting it anymore. Manual verification shows that it mostly |
| 20 |
works fine but it's not going to be part of the automated release |
| 21 |
process and thus likely to break in the future. |
| 22 |
|
| 23 |
As usual, current docs are at |
| 24 |
|
| 25 |
http://pytest.org |
| 26 |
|
| 27 |
and you can upgrade from pypi via:: |
| 28 |
|
| 29 |
pip install -U pytest |
| 30 |
|
| 31 |
Particular thanks for helping with this release go to Anatoly Bubenkoff, |
| 32 |
Floris Bruynooghe, Marc Abramowitz, Ralph Schmitt, Ronny Pfannschmidt, |
| 33 |
Donald Stufft, James Lan, Rob Dennis, Jason R. Coombs, Mathieu Agopian, |
| 34 |
Virgil Dupras, Bruno Oliveira, Alex Gaynor and others. |
| 35 |
|
| 36 |
have fun, |
| 37 |
holger krekel |
| 38 |
|
| 39 |
|
| 40 |
2.5.0 |
| 41 |
----------------------------------- |
| 42 |
|
| 43 |
- dropped python2.5 from automated release testing of pytest itself |
| 44 |
which means it's probably going to break soon (but still works |
| 45 |
with this release we believe). |
| 46 |
|
| 47 |
- simplified and fixed implementation for calling finalizers when |
| 48 |
parametrized fixtures or function arguments are involved. finalization |
| 49 |
is now performed lazily at setup time instead of in the "teardown phase". |
| 50 |
While this might sound odd at first, it helps to ensure that we are |
| 51 |
correctly handling setup/teardown even in complex code. User-level code |
| 52 |
should not be affected unless it's implementing the pytest_runtest_teardown |
| 53 |
hook and expecting certain fixture instances are torn down within (very |
| 54 |
unlikely and would have been unreliable anyway). |
| 55 |
|
| 56 |
- PR90: add --color=yes|no|auto option to force terminal coloring |
| 57 |
mode ("auto" is default). Thanks Marc Abramowitz. |
| 58 |
|
| 59 |
- fix issue319 - correctly show unicode in assertion errors. Many |
| 60 |
thanks to Floris Bruynooghe for the complete PR. Also means |
| 61 |
we depend on py>=1.4.19 now. |
| 62 |
|
| 63 |
- fix issue396 - correctly sort and finalize class-scoped parametrized |
| 64 |
tests independently from number of methods on the class. |
| 65 |
|
| 66 |
- refix issue323 in a better way -- parametrization should now never |
| 67 |
cause Runtime Recursion errors because the underlying algorithm |
| 68 |
for re-ordering tests per-scope/per-fixture is not recursive |
| 69 |
anymore (it was tail-call recursive before which could lead |
| 70 |
to problems for more than >966 non-function scoped parameters). |
| 71 |
|
| 72 |
- fix issue290 - there is preliminary support now for parametrizing |
| 73 |
with repeated same values (sometimes useful to test if calling |
| 74 |
a second time works as with the first time). |
| 75 |
|
| 76 |
- close issue240 - document precisely how pytest module importing |
| 77 |
works, discuss the two common test directory layouts, and how it |
| 78 |
interacts with PEP420-namespace packages. |
| 79 |
|
| 80 |
- fix issue246 fix finalizer order to be LIFO on independent fixtures |
| 81 |
depending on a parametrized higher-than-function scoped fixture. |
| 82 |
(was quite some effort so please bear with the complexity of this sentence :) |
| 83 |
Thanks Ralph Schmitt for the precise failure example. |
| 84 |
|
| 85 |
- fix issue244 by implementing special index for parameters to only use |
| 86 |
indices for parametrized test ids |
| 87 |
|
| 88 |
- fix issue287 by running all finalizers but saving the exception |
| 89 |
from the first failing finalizer and re-raising it so teardown will |
| 90 |
still have failed. We reraise the first failing exception because |
| 91 |
it might be the cause for other finalizers to fail. |
| 92 |
|
| 93 |
- fix ordering when mock.patch or other standard decorator-wrappings |
| 94 |
are used with test methods. This fixes issue346 and should |
| 95 |
help with random "xdist" collection failures. Thanks to |
| 96 |
Ronny Pfannschmidt and Donald Stufft for helping to isolate it. |
| 97 |
|
| 98 |
- fix issue357 - special case "-k" expressions to allow for |
| 99 |
filtering with simple strings that are not valid python expressions. |
| 100 |
Examples: "-k 1.3" matches all tests parametrized with 1.3. |
| 101 |
"-k None" filters all tests that have "None" in their name |
| 102 |
and conversely "-k 'not None'". |
| 103 |
Previously these examples would raise syntax errors. |
| 104 |
|
| 105 |
- fix issue384 by removing the trial support code |
| 106 |
since the unittest compat enhancements allow |
| 107 |
trial to handle it on its own |
| 108 |
|
| 109 |
- don't hide an ImportError when importing a plugin produces one. |
| 110 |
fixes issue375. |
| 111 |
|
| 112 |
- fix issue275 - allow usefixtures and autouse fixtures |
| 113 |
for running doctest text files. |
| 114 |
|
| 115 |
- fix issue380 by making --resultlog only rely on longrepr instead |
| 116 |
of the "reprcrash" attribute which only exists sometimes. |
| 117 |
|
| 118 |
- address issue122: allow @pytest.fixture(params=iterator) by exploding |
| 119 |
into a list early on. |
| 120 |
|
| 121 |
- fix pexpect-3.0 compatibility for pytest's own tests. |
| 122 |
(fixes issue386) |
| 123 |
|
| 124 |
- allow nested parametrize-value markers, thanks James Lan for the PR. |
| 125 |
|
| 126 |
- fix unicode handling with new monkeypatch.setattr(import_path, value) |
| 127 |
API. Thanks Rob Dennis. Fixes issue371. |
| 128 |
|
| 129 |
- fix unicode handling with junitxml, fixes issue368. |
| 130 |
|
| 131 |
- In assertion rewriting mode on Python 2, fix the detection of coding |
| 132 |
cookies. See issue #330. |
| 133 |
|
| 134 |
- make "--runxfail" turn imperative pytest.xfail calls into no ops |
| 135 |
(it already did neutralize pytest.mark.xfail markers) |
| 136 |
|
| 137 |
- refine pytest / pkg_resources interactions: The AssertionRewritingHook |
| 138 |
PEP302 compliant loader now registers itself with setuptools/pkg_resources |
| 139 |
properly so that the pkg_resources.resource_stream method works properly. |
| 140 |
Fixes issue366. Thanks for the investigations and full PR to Jason R. Coombs. |
| 141 |
|
| 142 |
- pytestconfig fixture is now session-scoped as it is the same object during the |
| 143 |
whole test run. Fixes issue370. |
| 144 |
|
| 145 |
- avoid one surprising case of marker malfunction/confusion:: |
| 146 |
|
| 147 |
@pytest.mark.some(lambda arg: ...) |
| 148 |
def test_function(): |
| 149 |
|
| 150 |
would not work correctly because pytest assumes @pytest.mark.some |
| 151 |
gets a function to be decorated already. We now at least detect if this |
| 152 |
arg is a lambda and thus the example will work. Thanks Alex Gaynor |
| 153 |
for bringing it up. |
| 154 |
|
| 155 |
- xfail a test on pypy that checks wrong encoding/ascii (pypy does |
| 156 |
not error out). fixes issue385. |
| 157 |
|
| 158 |
- internally make varnames() deal with classes's __init__, |
| 159 |
although it's not needed by pytest itself atm. Also |
| 160 |
fix caching. Fixes issue376. |
| 161 |
|
| 162 |
- fix issue221 - handle importing of namespace-package with no |
| 163 |
__init__.py properly. |
| 164 |
|
| 165 |
- refactor internal FixtureRequest handling to avoid monkeypatching. |
| 166 |
One of the positive user-facing effects is that the "request" object |
| 167 |
can now be used in closures. |
| 168 |
|
| 169 |
- fixed version comparison in pytest.importskip(modname, minverstring) |
| 170 |
|
| 171 |
- fix issue377 by clarifying in the nose-compat docs that pytest |
| 172 |
does not duplicate the unittest-API into the "plain" namespace. |
| 173 |
|
| 174 |
- fix verbose reporting for @mock'd test functions |