1.. 2 You should *NOT* be adding new change log entries to this file, this 3 file is managed by towncrier. You *may* edit previous change logs to 4 fix problems like typo corrections or such. 5 To add a new change log entry, please see 6 https://pip.pypa.io/en/latest/development/#adding-a-news-entry 7 we named the news folder changelog 8 9.. towncrier release notes start 10 11Pytest 3.3.0 (2017-11-23) 12========================= 13 14Deprecations and Removals 15------------------------- 16 17- Pytest no longer supports Python **2.6** and **3.3**. Those Python versions 18 are EOL for some time now and incur maintenance and compatibility costs on 19 the pytest core team, and following up with the rest of the community we 20 decided that they will no longer be supported starting on this version. Users 21 which still require those versions should pin pytest to ``<3.3``. (`#2812 22 <https://github.com/pytest-dev/pytest/issues/2812>`_) 23 24- Remove internal ``_preloadplugins()`` function. This removal is part of the 25 ``pytest_namespace()`` hook deprecation. (`#2636 26 <https://github.com/pytest-dev/pytest/issues/2636>`_) 27 28- Internally change ``CallSpec2`` to have a list of marks instead of a broken 29 mapping of keywords. This removes the keywords attribute of the internal 30 ``CallSpec2`` class. (`#2672 31 <https://github.com/pytest-dev/pytest/issues/2672>`_) 32 33- Remove ParameterSet.deprecated_arg_dict - its not a public api and the lack 34 of the underscore was a naming error. (`#2675 35 <https://github.com/pytest-dev/pytest/issues/2675>`_) 36 37- Remove the internal multi-typed attribute ``Node._evalskip`` and replace it 38 with the boolean ``Node._skipped_by_mark``. (`#2767 39 <https://github.com/pytest-dev/pytest/issues/2767>`_) 40 41- The ``params`` list passed to ``pytest.fixture`` is now for 42 all effects considered immutable and frozen at the moment of the ``pytest.fixture`` 43 call. Previously the list could be changed before the first invocation of the fixture 44 allowing for a form of dynamic parametrization (for example, updated from command-line options), 45 but this was an unwanted implementation detail which complicated the internals and prevented 46 some internal cleanup. See issue `#2959 <https://github.com/pytest-dev/pytest/issues/2959>`_ 47 for details and a recommended workaround. 48 49Features 50-------- 51 52- ``pytest_fixture_post_finalizer`` hook can now receive a ``request`` 53 argument. (`#2124 <https://github.com/pytest-dev/pytest/issues/2124>`_) 54 55- Replace the old introspection code in compat.py that determines the available 56 arguments of fixtures with inspect.signature on Python 3 and 57 funcsigs.signature on Python 2. This should respect ``__signature__`` 58 declarations on functions. (`#2267 59 <https://github.com/pytest-dev/pytest/issues/2267>`_) 60 61- Report tests with global ``pytestmark`` variable only once. (`#2549 62 <https://github.com/pytest-dev/pytest/issues/2549>`_) 63 64- Now pytest displays the total progress percentage while running tests. The 65 previous output style can be set by configuring the ``console_output_style`` 66 setting to ``classic``. (`#2657 <https://github.com/pytest-dev/pytest/issues/2657>`_) 67 68- Match ``warns`` signature to ``raises`` by adding ``match`` keyword. (`#2708 69 <https://github.com/pytest-dev/pytest/issues/2708>`_) 70 71- Pytest now captures and displays output from the standard `logging` module. 72 The user can control the logging level to be captured by specifying options 73 in ``pytest.ini``, the command line and also during individual tests using 74 markers. Also, a ``caplog`` fixture is available that enables users to test 75 the captured log during specific tests (similar to ``capsys`` for example). 76 For more information, please see the `logging docs 77 <https://docs.pytest.org/en/latest/logging.html>`_. This feature was 78 introduced by merging the popular `pytest-catchlog 79 <https://pypi.org/project/pytest-catchlog/>`_ plugin, thanks to `Thomas Hisch 80 <https://github.com/thisch>`_. Be advised that during the merging the 81 backward compatibility interface with the defunct ``pytest-capturelog`` has 82 been dropped. (`#2794 <https://github.com/pytest-dev/pytest/issues/2794>`_) 83 84- Add ``allow_module_level`` kwarg to ``pytest.skip()``, enabling to skip the 85 whole module. (`#2808 <https://github.com/pytest-dev/pytest/issues/2808>`_) 86 87- Allow setting ``file_or_dir``, ``-c``, and ``-o`` in PYTEST_ADDOPTS. (`#2824 88 <https://github.com/pytest-dev/pytest/issues/2824>`_) 89 90- Return stdout/stderr capture results as a ``namedtuple``, so ``out`` and 91 ``err`` can be accessed by attribute. (`#2879 92 <https://github.com/pytest-dev/pytest/issues/2879>`_) 93 94- Add ``capfdbinary``, a version of ``capfd`` which returns bytes from 95 ``readouterr()``. (`#2923 96 <https://github.com/pytest-dev/pytest/issues/2923>`_) 97 98- Add ``capsysbinary`` a version of ``capsys`` which returns bytes from 99 ``readouterr()``. (`#2934 100 <https://github.com/pytest-dev/pytest/issues/2934>`_) 101 102- Implement feature to skip ``setup.py`` files when run with 103 ``--doctest-modules``. (`#502 104 <https://github.com/pytest-dev/pytest/issues/502>`_) 105 106 107Bug Fixes 108--------- 109 110- Resume output capturing after ``capsys/capfd.disabled()`` context manager. 111 (`#1993 <https://github.com/pytest-dev/pytest/issues/1993>`_) 112 113- ``pytest_fixture_setup`` and ``pytest_fixture_post_finalizer`` hooks are now 114 called for all ``conftest.py`` files. (`#2124 115 <https://github.com/pytest-dev/pytest/issues/2124>`_) 116 117- If an exception happens while loading a plugin, pytest no longer hides the 118 original traceback. In python2 it will show the original traceback with a new 119 message that explains in which plugin. In python3 it will show 2 canonized 120 exceptions, the original exception while loading the plugin in addition to an 121 exception that PyTest throws about loading a plugin. (`#2491 122 <https://github.com/pytest-dev/pytest/issues/2491>`_) 123 124- ``capsys`` and ``capfd`` can now be used by other fixtures. (`#2709 125 <https://github.com/pytest-dev/pytest/issues/2709>`_) 126 127- Internal ``pytester`` plugin properly encodes ``bytes`` arguments to 128 ``utf-8``. (`#2738 <https://github.com/pytest-dev/pytest/issues/2738>`_) 129 130- ``testdir`` now uses use the same method used by ``tmpdir`` to create its 131 temporary directory. This changes the final structure of the ``testdir`` 132 directory slightly, but should not affect usage in normal scenarios and 133 avoids a number of potential problems. (`#2751 134 <https://github.com/pytest-dev/pytest/issues/2751>`_) 135 136- Pytest no longer complains about warnings with unicode messages being 137 non-ascii compatible even for ascii-compatible messages. As a result of this, 138 warnings with unicode messages are converted first to an ascii representation 139 for safety. (`#2809 <https://github.com/pytest-dev/pytest/issues/2809>`_) 140 141- Change return value of pytest command when ``--maxfail`` is reached from 142 ``2`` (interrupted) to ``1`` (failed). (`#2845 143 <https://github.com/pytest-dev/pytest/issues/2845>`_) 144 145- Fix issue in assertion rewriting which could lead it to rewrite modules which 146 should not be rewritten. (`#2939 147 <https://github.com/pytest-dev/pytest/issues/2939>`_) 148 149- Handle marks without description in ``pytest.ini``. (`#2942 150 <https://github.com/pytest-dev/pytest/issues/2942>`_) 151 152 153Trivial/Internal Changes 154------------------------ 155 156- pytest now depends on `attrs <https://pypi.org/project/attrs/>`_ for internal 157 structures to ease code maintainability. (`#2641 158 <https://github.com/pytest-dev/pytest/issues/2641>`_) 159 160- Refactored internal Python 2/3 compatibility code to use ``six``. (`#2642 161 <https://github.com/pytest-dev/pytest/issues/2642>`_) 162 163- Stop vendoring ``pluggy`` - we're missing out on its latest changes for not 164 much benefit (`#2719 <https://github.com/pytest-dev/pytest/issues/2719>`_) 165 166- Internal refactor: simplify ascii string escaping by using the 167 backslashreplace error handler in newer Python 3 versions. (`#2734 168 <https://github.com/pytest-dev/pytest/issues/2734>`_) 169 170- Remove unnecessary mark evaluator in unittest plugin (`#2767 171 <https://github.com/pytest-dev/pytest/issues/2767>`_) 172 173- Calls to ``Metafunc.addcall`` now emit a deprecation warning. This function 174 is scheduled to be removed in ``pytest-4.0``. (`#2876 175 <https://github.com/pytest-dev/pytest/issues/2876>`_) 176 177- Internal move of the parameterset extraction to a more maintainable place. 178 (`#2877 <https://github.com/pytest-dev/pytest/issues/2877>`_) 179 180- Internal refactoring to simplify scope node lookup. (`#2910 181 <https://github.com/pytest-dev/pytest/issues/2910>`_) 182 183- Configure ``pytest`` to prevent pip from installing pytest in unsupported 184 Python versions. (`#2922 185 <https://github.com/pytest-dev/pytest/issues/2922>`_) 186 187 188Pytest 3.2.5 (2017-11-15) 189========================= 190 191Bug Fixes 192--------- 193 194- Remove ``py<1.5`` restriction from ``pytest`` as this can cause version 195 conflicts in some installations. (`#2926 196 <https://github.com/pytest-dev/pytest/issues/2926>`_) 197 198 199Pytest 3.2.4 (2017-11-13) 200========================= 201 202Bug Fixes 203--------- 204 205- Fix the bug where running with ``--pyargs`` will result in items with 206 empty ``parent.nodeid`` if run from a different root directory. (`#2775 207 <https://github.com/pytest-dev/pytest/issues/2775>`_) 208 209- Fix issue with ``@pytest.parametrize`` if argnames was specified as keyword arguments. 210 (`#2819 <https://github.com/pytest-dev/pytest/issues/2819>`_) 211 212- Strip whitespace from marker names when reading them from INI config. (`#2856 213 <https://github.com/pytest-dev/pytest/issues/2856>`_) 214 215- Show full context of doctest source in the pytest output, if the line number of 216 failed example in the docstring is < 9. (`#2882 217 <https://github.com/pytest-dev/pytest/issues/2882>`_) 218 219- Match fixture paths against actual path segments in order to avoid matching folders which share a prefix. 220 (`#2836 <https://github.com/pytest-dev/pytest/issues/2836>`_) 221 222Improved Documentation 223---------------------- 224 225- Introduce a dedicated section about conftest.py. (`#1505 226 <https://github.com/pytest-dev/pytest/issues/1505>`_) 227 228- Explicitly mention ``xpass`` in the documentation of ``xfail``. (`#1997 229 <https://github.com/pytest-dev/pytest/issues/1997>`_) 230 231- Append example for pytest.param in the example/parametrize document. (`#2658 232 <https://github.com/pytest-dev/pytest/issues/2658>`_) 233 234- Clarify language of proposal for fixtures parameters (`#2893 235 <https://github.com/pytest-dev/pytest/issues/2893>`_) 236 237- List python 3.6 in the documented supported versions in the getting started 238 document. (`#2903 <https://github.com/pytest-dev/pytest/issues/2903>`_) 239 240- Clarify the documentation of available fixture scopes. (`#538 241 <https://github.com/pytest-dev/pytest/issues/538>`_) 242 243- Add documentation about the ``python -m pytest`` invocation adding the 244 current directory to sys.path. (`#911 245 <https://github.com/pytest-dev/pytest/issues/911>`_) 246 247 248Pytest 3.2.3 (2017-10-03) 249========================= 250 251Bug Fixes 252--------- 253 254- Fix crash in tab completion when no prefix is given. (`#2748 255 <https://github.com/pytest-dev/pytest/issues/2748>`_) 256 257- The equality checking function (``__eq__``) of ``MarkDecorator`` returns 258 ``False`` if one object is not an instance of ``MarkDecorator``. (`#2758 259 <https://github.com/pytest-dev/pytest/issues/2758>`_) 260 261- When running ``pytest --fixtures-per-test``: don't crash if an item has no 262 _fixtureinfo attribute (e.g. doctests) (`#2788 263 <https://github.com/pytest-dev/pytest/issues/2788>`_) 264 265 266Improved Documentation 267---------------------- 268 269- In help text of ``-k`` option, add example of using ``not`` to not select 270 certain tests whose names match the provided expression. (`#1442 271 <https://github.com/pytest-dev/pytest/issues/1442>`_) 272 273- Add note in ``parametrize.rst`` about calling ``metafunc.parametrize`` 274 multiple times. (`#1548 <https://github.com/pytest-dev/pytest/issues/1548>`_) 275 276 277Trivial/Internal Changes 278------------------------ 279 280- Set ``xfail_strict=True`` in pytest's own test suite to catch expected 281 failures as soon as they start to pass. (`#2722 282 <https://github.com/pytest-dev/pytest/issues/2722>`_) 283 284- Fix typo in example of passing a callable to markers (in example/markers.rst) 285 (`#2765 <https://github.com/pytest-dev/pytest/issues/2765>`_) 286 287 288Pytest 3.2.2 (2017-09-06) 289========================= 290 291Bug Fixes 292--------- 293 294- Calling the deprecated `request.getfuncargvalue()` now shows the source of 295 the call. (`#2681 <https://github.com/pytest-dev/pytest/issues/2681>`_) 296 297- Allow tests declared as ``@staticmethod`` to use fixtures. (`#2699 298 <https://github.com/pytest-dev/pytest/issues/2699>`_) 299 300- Fixed edge-case during collection: attributes which raised ``pytest.fail`` 301 when accessed would abort the entire collection. (`#2707 302 <https://github.com/pytest-dev/pytest/issues/2707>`_) 303 304- Fix ``ReprFuncArgs`` with mixed unicode and UTF-8 args. (`#2731 305 <https://github.com/pytest-dev/pytest/issues/2731>`_) 306 307 308Improved Documentation 309---------------------- 310 311- In examples on working with custom markers, add examples demonstrating the 312 usage of ``pytest.mark.MARKER_NAME.with_args`` in comparison with 313 ``pytest.mark.MARKER_NAME.__call__`` (`#2604 314 <https://github.com/pytest-dev/pytest/issues/2604>`_) 315 316- In one of the simple examples, use `pytest_collection_modifyitems()` to skip 317 tests based on a command-line option, allowing its sharing while preventing a 318 user error when acessing `pytest.config` before the argument parsing. (`#2653 319 <https://github.com/pytest-dev/pytest/issues/2653>`_) 320 321 322Trivial/Internal Changes 323------------------------ 324 325- Fixed minor error in 'Good Practices/Manual Integration' code snippet. 326 (`#2691 <https://github.com/pytest-dev/pytest/issues/2691>`_) 327 328- Fixed typo in goodpractices.rst. (`#2721 329 <https://github.com/pytest-dev/pytest/issues/2721>`_) 330 331- Improve user guidance regarding ``--resultlog`` deprecation. (`#2739 332 <https://github.com/pytest-dev/pytest/issues/2739>`_) 333 334 335Pytest 3.2.1 (2017-08-08) 336========================= 337 338Bug Fixes 339--------- 340 341- Fixed small terminal glitch when collecting a single test item. (`#2579 342 <https://github.com/pytest-dev/pytest/issues/2579>`_) 343 344- Correctly consider ``/`` as the file separator to automatically mark plugin 345 files for rewrite on Windows. (`#2591 <https://github.com/pytest- 346 dev/pytest/issues/2591>`_) 347 348- Properly escape test names when setting ``PYTEST_CURRENT_TEST`` environment 349 variable. (`#2644 <https://github.com/pytest-dev/pytest/issues/2644>`_) 350 351- Fix error on Windows and Python 3.6+ when ``sys.stdout`` has been replaced 352 with a stream-like object which does not implement the full ``io`` module 353 buffer protocol. In particular this affects ``pytest-xdist`` users on the 354 aforementioned platform. (`#2666 <https://github.com/pytest- 355 dev/pytest/issues/2666>`_) 356 357 358Improved Documentation 359---------------------- 360 361- Explicitly document which pytest features work with ``unittest``. (`#2626 362 <https://github.com/pytest-dev/pytest/issues/2626>`_) 363 364 365Pytest 3.2.0 (2017-07-30) 366========================= 367 368Deprecations and Removals 369------------------------- 370 371- ``pytest.approx`` no longer supports ``>``, ``>=``, ``<`` and ``<=`` 372 operators to avoid surprising/inconsistent behavior. See `the approx docs 373 <https://docs.pytest.org/en/latest/builtin.html#pytest.approx>`_ for more 374 information. (`#2003 <https://github.com/pytest-dev/pytest/issues/2003>`_) 375 376- All old-style specific behavior in current classes in the pytest's API is 377 considered deprecated at this point and will be removed in a future release. 378 This affects Python 2 users only and in rare situations. (`#2147 379 <https://github.com/pytest-dev/pytest/issues/2147>`_) 380 381- A deprecation warning is now raised when using marks for parameters 382 in ``pytest.mark.parametrize``. Use ``pytest.param`` to apply marks to 383 parameters instead. (`#2427 <https://github.com/pytest-dev/pytest/issues/2427>`_) 384 385 386Features 387-------- 388 389- Add support for numpy arrays (and dicts) to approx. (`#1994 390 <https://github.com/pytest-dev/pytest/issues/1994>`_) 391 392- Now test function objects have a ``pytestmark`` attribute containing a list 393 of marks applied directly to the test function, as opposed to marks inherited 394 from parent classes or modules. (`#2516 <https://github.com/pytest- 395 dev/pytest/issues/2516>`_) 396 397- Collection ignores local virtualenvs by default; `--collect-in-virtualenv` 398 overrides this behavior. (`#2518 <https://github.com/pytest- 399 dev/pytest/issues/2518>`_) 400 401- Allow class methods decorated as ``@staticmethod`` to be candidates for 402 collection as a test function. (Only for Python 2.7 and above. Python 2.6 403 will still ignore static methods.) (`#2528 <https://github.com/pytest- 404 dev/pytest/issues/2528>`_) 405 406- Introduce ``mark.with_args`` in order to allow passing functions/classes as 407 sole argument to marks. (`#2540 <https://github.com/pytest- 408 dev/pytest/issues/2540>`_) 409 410- New ``cache_dir`` ini option: sets the directory where the contents of the 411 cache plugin are stored. Directory may be relative or absolute path: if relative path, then 412 directory is created relative to ``rootdir``, otherwise it is used as is. 413 Additionally path may contain environment variables which are expanded during 414 runtime. (`#2543 <https://github.com/pytest-dev/pytest/issues/2543>`_) 415 416- Introduce the ``PYTEST_CURRENT_TEST`` environment variable that is set with 417 the ``nodeid`` and stage (``setup``, ``call`` and ``teardown``) of the test 418 being currently executed. See the `documentation 419 <https://docs.pytest.org/en/latest/example/simple.html#pytest-current-test- 420 environment-variable>`_ for more info. (`#2583 <https://github.com/pytest- 421 dev/pytest/issues/2583>`_) 422 423- Introduced ``@pytest.mark.filterwarnings`` mark which allows overwriting the 424 warnings filter on a per test, class or module level. See the `docs 425 <https://docs.pytest.org/en/latest/warnings.html#pytest-mark- 426 filterwarnings>`_ for more information. (`#2598 <https://github.com/pytest- 427 dev/pytest/issues/2598>`_) 428 429- ``--last-failed`` now remembers forever when a test has failed and only 430 forgets it if it passes again. This makes it easy to fix a test suite by 431 selectively running files and fixing tests incrementally. (`#2621 432 <https://github.com/pytest-dev/pytest/issues/2621>`_) 433 434- New ``pytest_report_collectionfinish`` hook which allows plugins to add 435 messages to the terminal reporting after collection has been finished 436 successfully. (`#2622 <https://github.com/pytest-dev/pytest/issues/2622>`_) 437 438- Added support for `PEP-415's <https://www.python.org/dev/peps/pep-0415/>`_ 439 ``Exception.__suppress_context__``. Now if a ``raise exception from None`` is 440 caught by pytest, pytest will no longer chain the context in the test report. 441 The behavior now matches Python's traceback behavior. (`#2631 442 <https://github.com/pytest-dev/pytest/issues/2631>`_) 443 444- Exceptions raised by ``pytest.fail``, ``pytest.skip`` and ``pytest.xfail`` 445 now subclass BaseException, making them harder to be caught unintentionally 446 by normal code. (`#580 <https://github.com/pytest-dev/pytest/issues/580>`_) 447 448 449Bug Fixes 450--------- 451 452- Set ``stdin`` to a closed ``PIPE`` in ``pytester.py.Testdir.popen()`` for 453 avoid unwanted interactive ``pdb`` (`#2023 <https://github.com/pytest- 454 dev/pytest/issues/2023>`_) 455 456- Add missing ``encoding`` attribute to ``sys.std*`` streams when using 457 ``capsys`` capture mode. (`#2375 <https://github.com/pytest- 458 dev/pytest/issues/2375>`_) 459 460- Fix terminal color changing to black on Windows if ``colorama`` is imported 461 in a ``conftest.py`` file. (`#2510 <https://github.com/pytest- 462 dev/pytest/issues/2510>`_) 463 464- Fix line number when reporting summary of skipped tests. (`#2548 465 <https://github.com/pytest-dev/pytest/issues/2548>`_) 466 467- capture: ensure that EncodedFile.name is a string. (`#2555 468 <https://github.com/pytest-dev/pytest/issues/2555>`_) 469 470- The options ``--fixtures`` and ``--fixtures-per-test`` will now keep 471 indentation within docstrings. (`#2574 <https://github.com/pytest- 472 dev/pytest/issues/2574>`_) 473 474- doctests line numbers are now reported correctly, fixing `pytest-sugar#122 475 <https://github.com/Frozenball/pytest-sugar/issues/122>`_. (`#2610 476 <https://github.com/pytest-dev/pytest/issues/2610>`_) 477 478- Fix non-determinism in order of fixture collection. Adds new dependency 479 (ordereddict) for Python 2.6. (`#920 <https://github.com/pytest- 480 dev/pytest/issues/920>`_) 481 482 483Improved Documentation 484---------------------- 485 486- Clarify ``pytest_configure`` hook call order. (`#2539 487 <https://github.com/pytest-dev/pytest/issues/2539>`_) 488 489- Extend documentation for testing plugin code with the ``pytester`` plugin. 490 (`#971 <https://github.com/pytest-dev/pytest/issues/971>`_) 491 492 493Trivial/Internal Changes 494------------------------ 495 496- Update help message for ``--strict`` to make it clear it only deals with 497 unregistered markers, not warnings. (`#2444 <https://github.com/pytest- 498 dev/pytest/issues/2444>`_) 499 500- Internal code move: move code for pytest.approx/pytest.raises to own files in 501 order to cut down the size of python.py (`#2489 <https://github.com/pytest- 502 dev/pytest/issues/2489>`_) 503 504- Renamed the utility function ``_pytest.compat._escape_strings`` to 505 ``_ascii_escaped`` to better communicate the function's purpose. (`#2533 506 <https://github.com/pytest-dev/pytest/issues/2533>`_) 507 508- Improve error message for CollectError with skip/skipif. (`#2546 509 <https://github.com/pytest-dev/pytest/issues/2546>`_) 510 511- Emit warning about ``yield`` tests being deprecated only once per generator. 512 (`#2562 <https://github.com/pytest-dev/pytest/issues/2562>`_) 513 514- Ensure final collected line doesn't include artifacts of previous write. 515 (`#2571 <https://github.com/pytest-dev/pytest/issues/2571>`_) 516 517- Fixed all flake8 errors and warnings. (`#2581 <https://github.com/pytest- 518 dev/pytest/issues/2581>`_) 519 520- Added ``fix-lint`` tox environment to run automatic pep8 fixes on the code. 521 (`#2582 <https://github.com/pytest-dev/pytest/issues/2582>`_) 522 523- Turn warnings into errors in pytest's own test suite in order to catch 524 regressions due to deprecations more promptly. (`#2588 525 <https://github.com/pytest-dev/pytest/issues/2588>`_) 526 527- Show multiple issue links in CHANGELOG entries. (`#2620 528 <https://github.com/pytest-dev/pytest/issues/2620>`_) 529 530 531Pytest 3.1.3 (2017-07-03) 532========================= 533 534Bug Fixes 535--------- 536 537- Fix decode error in Python 2 for doctests in docstrings. (`#2434 538 <https://github.com/pytest-dev/pytest/issues/2434>`_) 539 540- Exceptions raised during teardown by finalizers are now suppressed until all 541 finalizers are called, with the initial exception reraised. (`#2440 542 <https://github.com/pytest-dev/pytest/issues/2440>`_) 543 544- Fix incorrect "collected items" report when specifying tests on the command- 545 line. (`#2464 <https://github.com/pytest-dev/pytest/issues/2464>`_) 546 547- ``deprecated_call`` in context-manager form now captures deprecation warnings 548 even if the same warning has already been raised. Also, ``deprecated_call`` 549 will always produce the same error message (previously it would produce 550 different messages in context-manager vs. function-call mode). (`#2469 551 <https://github.com/pytest-dev/pytest/issues/2469>`_) 552 553- Fix issue where paths collected by pytest could have triple leading ``/`` 554 characters. (`#2475 <https://github.com/pytest-dev/pytest/issues/2475>`_) 555 556- Fix internal error when trying to detect the start of a recursive traceback. 557 (`#2486 <https://github.com/pytest-dev/pytest/issues/2486>`_) 558 559 560Improved Documentation 561---------------------- 562 563- Explicitly state for which hooks the calls stop after the first non-None 564 result. (`#2493 <https://github.com/pytest-dev/pytest/issues/2493>`_) 565 566 567Trivial/Internal Changes 568------------------------ 569 570- Create invoke tasks for updating the vendored packages. (`#2474 571 <https://github.com/pytest-dev/pytest/issues/2474>`_) 572 573- Update copyright dates in LICENSE, README.rst and in the documentation. 574 (`#2499 <https://github.com/pytest-dev/pytest/issues/2499>`_) 575 576 577Pytest 3.1.2 (2017-06-08) 578========================= 579 580Bug Fixes 581--------- 582 583- Required options added via ``pytest_addoption`` will no longer prevent using 584 --help without passing them. (#1999) 585 586- Respect ``python_files`` in assertion rewriting. (#2121) 587 588- Fix recursion error detection when frames in the traceback contain objects 589 that can't be compared (like ``numpy`` arrays). (#2459) 590 591- ``UnicodeWarning`` is issued from the internal pytest warnings plugin only 592 when the message contains non-ascii unicode (Python 2 only). (#2463) 593 594- Added a workaround for Python 3.6 ``WindowsConsoleIO`` breaking due to Pytests's 595 ``FDCapture``. Other code using console handles might still be affected by the 596 very same issue and might require further workarounds/fixes, i.e. ``colorama``. 597 (#2467) 598 599 600Improved Documentation 601---------------------- 602 603- Fix internal API links to ``pluggy`` objects. (#2331) 604 605- Make it clear that ``pytest.xfail`` stops test execution at the calling point 606 and improve overall flow of the ``skipping`` docs. (#810) 607 608 609Pytest 3.1.1 (2017-05-30) 610========================= 611 612Bug Fixes 613--------- 614 615- pytest warning capture no longer overrides existing warning filters. The 616 previous behaviour would override all filters and caused regressions in test 617 suites which configure warning filters to match their needs. Note that as a 618 side-effect of this is that ``DeprecationWarning`` and 619 ``PendingDeprecationWarning`` are no longer shown by default. (#2430) 620 621- Fix issue with non-ascii contents in doctest text files. (#2434) 622 623- Fix encoding errors for unicode warnings in Python 2. (#2436) 624 625- ``pytest.deprecated_call`` now captures ``PendingDeprecationWarning`` in 626 context manager form. (#2441) 627 628 629Improved Documentation 630---------------------- 631 632- Addition of towncrier for changelog management. (#2390) 633 634 6353.1.0 (2017-05-22) 636================== 637 638 639New Features 640------------ 641 642* The ``pytest-warnings`` plugin has been integrated into the core and now ``pytest`` automatically 643 captures and displays warnings at the end of the test session. 644 645 .. warning:: 646 647 This feature may disrupt test suites which apply and treat warnings themselves, and can be 648 disabled in your ``pytest.ini``: 649 650 .. code-block:: ini 651 652 [pytest] 653 addopts = -p no:warnings 654 655 See the `warnings documentation page <https://docs.pytest.org/en/latest/warnings.html>`_ for more 656 information. 657 658 Thanks `@nicoddemus`_ for the PR. 659 660* Added ``junit_suite_name`` ini option to specify root ``<testsuite>`` name for JUnit XML reports (`#533`_). 661 662* Added an ini option ``doctest_encoding`` to specify which encoding to use for doctest files. 663 Thanks `@wheerd`_ for the PR (`#2101`_). 664 665* ``pytest.warns`` now checks for subclass relationship rather than 666 class equality. Thanks `@lesteve`_ for the PR (`#2166`_) 667 668* ``pytest.raises`` now asserts that the error message matches a text or regex 669 with the ``match`` keyword argument. Thanks `@Kriechi`_ for the PR. 670 671* ``pytest.param`` can be used to declare test parameter sets with marks and test ids. 672 Thanks `@RonnyPfannschmidt`_ for the PR. 673 674 675Changes 676------- 677 678* remove all internal uses of pytest_namespace hooks, 679 this is to prepare the removal of preloadconfig in pytest 4.0 680 Thanks to `@RonnyPfannschmidt`_ for the PR. 681 682* pytest now warns when a callable ids raises in a parametrized test. Thanks `@fogo`_ for the PR. 683 684* It is now possible to skip test classes from being collected by setting a 685 ``__test__`` attribute to ``False`` in the class body (`#2007`_). Thanks 686 to `@syre`_ for the report and `@lwm`_ for the PR. 687 688* Change junitxml.py to produce reports that comply with Junitxml schema. 689 If the same test fails with failure in call and then errors in teardown 690 we split testcase element into two, one containing the error and the other 691 the failure. (`#2228`_) Thanks to `@kkoukiou`_ for the PR. 692 693* Testcase reports with a ``url`` attribute will now properly write this to junitxml. 694 Thanks `@fushi`_ for the PR (`#1874`_). 695 696* Remove common items from dict comparision output when verbosity=1. Also update 697 the truncation message to make it clearer that pytest truncates all 698 assertion messages if verbosity < 2 (`#1512`_). 699 Thanks `@mattduck`_ for the PR 700 701* ``--pdbcls`` no longer implies ``--pdb``. This makes it possible to use 702 ``addopts=--pdbcls=module.SomeClass`` on ``pytest.ini``. Thanks `@davidszotten`_ for 703 the PR (`#1952`_). 704 705* fix `#2013`_: turn RecordedWarning into ``namedtuple``, 706 to give it a comprehensible repr while preventing unwarranted modification. 707 708* fix `#2208`_: ensure a iteration limit for _pytest.compat.get_real_func. 709 Thanks `@RonnyPfannschmidt`_ for the report and PR. 710 711* Hooks are now verified after collection is complete, rather than right after loading installed plugins. This 712 makes it easy to write hooks for plugins which will be loaded during collection, for example using the 713 ``pytest_plugins`` special variable (`#1821`_). 714 Thanks `@nicoddemus`_ for the PR. 715 716* Modify ``pytest_make_parametrize_id()`` hook to accept ``argname`` as an 717 additional parameter. 718 Thanks `@unsignedint`_ for the PR. 719 720* Add ``venv`` to the default ``norecursedirs`` setting. 721 Thanks `@The-Compiler`_ for the PR. 722 723* ``PluginManager.import_plugin`` now accepts unicode plugin names in Python 2. 724 Thanks `@reutsharabani`_ for the PR. 725 726* fix `#2308`_: When using both ``--lf`` and ``--ff``, only the last failed tests are run. 727 Thanks `@ojii`_ for the PR. 728 729* Replace minor/patch level version numbers in the documentation with placeholders. 730 This significantly reduces change-noise as different contributors regnerate 731 the documentation on different platforms. 732 Thanks `@RonnyPfannschmidt`_ for the PR. 733 734* fix `#2391`_: consider pytest_plugins on all plugin modules 735 Thanks `@RonnyPfannschmidt`_ for the PR. 736 737 738Bug Fixes 739--------- 740 741* Fix ``AttributeError`` on ``sys.stdout.buffer`` / ``sys.stderr.buffer`` 742 while using ``capsys`` fixture in python 3. (`#1407`_). 743 Thanks to `@asottile`_. 744 745* Change capture.py's ``DontReadFromInput`` class to throw ``io.UnsupportedOperation`` errors rather 746 than ValueErrors in the ``fileno`` method (`#2276`_). 747 Thanks `@metasyn`_ and `@vlad-dragos`_ for the PR. 748 749* Fix exception formatting while importing modules when the exception message 750 contains non-ascii characters (`#2336`_). 751 Thanks `@fabioz`_ for the report and `@nicoddemus`_ for the PR. 752 753* Added documentation related to issue (`#1937`_) 754 Thanks `@skylarjhdownes`_ for the PR. 755 756* Allow collecting files with any file extension as Python modules (`#2369`_). 757 Thanks `@Kodiologist`_ for the PR. 758 759* Show the correct error message when collect "parametrize" func with wrong args (`#2383`_). 760 Thanks `@The-Compiler`_ for the report and `@robin0371`_ for the PR. 761 762 763.. _@davidszotten: https://github.com/davidszotten 764.. _@fabioz: https://github.com/fabioz 765.. _@fogo: https://github.com/fogo 766.. _@fushi: https://github.com/fushi 767.. _@Kodiologist: https://github.com/Kodiologist 768.. _@Kriechi: https://github.com/Kriechi 769.. _@mandeep: https://github.com/mandeep 770.. _@mattduck: https://github.com/mattduck 771.. _@metasyn: https://github.com/metasyn 772.. _@MichalTHEDUDE: https://github.com/MichalTHEDUDE 773.. _@ojii: https://github.com/ojii 774.. _@reutsharabani: https://github.com/reutsharabani 775.. _@robin0371: https://github.com/robin0371 776.. _@skylarjhdownes: https://github.com/skylarjhdownes 777.. _@unsignedint: https://github.com/unsignedint 778.. _@wheerd: https://github.com/wheerd 779 780 781.. _#1407: https://github.com/pytest-dev/pytest/issues/1407 782.. _#1512: https://github.com/pytest-dev/pytest/issues/1512 783.. _#1821: https://github.com/pytest-dev/pytest/issues/1821 784.. _#1874: https://github.com/pytest-dev/pytest/pull/1874 785.. _#1937: https://github.com/pytest-dev/pytest/issues/1937 786.. _#1952: https://github.com/pytest-dev/pytest/pull/1952 787.. _#2007: https://github.com/pytest-dev/pytest/issues/2007 788.. _#2013: https://github.com/pytest-dev/pytest/issues/2013 789.. _#2101: https://github.com/pytest-dev/pytest/pull/2101 790.. _#2166: https://github.com/pytest-dev/pytest/pull/2166 791.. _#2208: https://github.com/pytest-dev/pytest/issues/2208 792.. _#2228: https://github.com/pytest-dev/pytest/issues/2228 793.. _#2276: https://github.com/pytest-dev/pytest/issues/2276 794.. _#2308: https://github.com/pytest-dev/pytest/issues/2308 795.. _#2336: https://github.com/pytest-dev/pytest/issues/2336 796.. _#2369: https://github.com/pytest-dev/pytest/issues/2369 797.. _#2383: https://github.com/pytest-dev/pytest/issues/2383 798.. _#2391: https://github.com/pytest-dev/pytest/issues/2391 799.. _#533: https://github.com/pytest-dev/pytest/issues/533 800 801 802 8033.0.7 (2017-03-14) 804================== 805 806 807* Fix issue in assertion rewriting breaking due to modules silently discarding 808 other modules when importing fails 809 Notably, importing the ``anydbm`` module is fixed. (`#2248`_). 810 Thanks `@pfhayes`_ for the PR. 811 812* junitxml: Fix problematic case where system-out tag occured twice per testcase 813 element in the XML report. Thanks `@kkoukiou`_ for the PR. 814 815* Fix regression, pytest now skips unittest correctly if run with ``--pdb`` 816 (`#2137`_). Thanks to `@gst`_ for the report and `@mbyt`_ for the PR. 817 818* Ignore exceptions raised from descriptors (e.g. properties) during Python test collection (`#2234`_). 819 Thanks to `@bluetech`_. 820 821* ``--override-ini`` now correctly overrides some fundamental options like ``python_files`` (`#2238`_). 822 Thanks `@sirex`_ for the report and `@nicoddemus`_ for the PR. 823 824* Replace ``raise StopIteration`` usages in the code by simple ``returns`` to finish generators, in accordance to `PEP-479`_ (`#2160`_). 825 Thanks `@tgoodlet`_ for the report and `@nicoddemus`_ for the PR. 826 827* Fix internal errors when an unprintable ``AssertionError`` is raised inside a test. 828 Thanks `@omerhadari`_ for the PR. 829 830* Skipping plugin now also works with test items generated by custom collectors (`#2231`_). 831 Thanks to `@vidartf`_. 832 833* Fix trailing whitespace in console output if no .ini file presented (`#2281`_). Thanks `@fbjorn`_ for the PR. 834 835* Conditionless ``xfail`` markers no longer rely on the underlying test item 836 being an instance of ``PyobjMixin``, and can therefore apply to tests not 837 collected by the built-in python test collector. Thanks `@barneygale`_ for the 838 PR. 839 840 841.. _@pfhayes: https://github.com/pfhayes 842.. _@bluetech: https://github.com/bluetech 843.. _@gst: https://github.com/gst 844.. _@sirex: https://github.com/sirex 845.. _@vidartf: https://github.com/vidartf 846.. _@kkoukiou: https://github.com/KKoukiou 847.. _@omerhadari: https://github.com/omerhadari 848.. _@fbjorn: https://github.com/fbjorn 849 850.. _#2248: https://github.com/pytest-dev/pytest/issues/2248 851.. _#2137: https://github.com/pytest-dev/pytest/issues/2137 852.. _#2160: https://github.com/pytest-dev/pytest/issues/2160 853.. _#2231: https://github.com/pytest-dev/pytest/issues/2231 854.. _#2234: https://github.com/pytest-dev/pytest/issues/2234 855.. _#2238: https://github.com/pytest-dev/pytest/issues/2238 856.. _#2281: https://github.com/pytest-dev/pytest/issues/2281 857 858.. _PEP-479: https://www.python.org/dev/peps/pep-0479/ 859 860 8613.0.6 (2017-01-22) 862================== 863 864* pytest no longer generates ``PendingDeprecationWarning`` from its own operations, which was introduced by mistake in version ``3.0.5`` (`#2118`_). 865 Thanks to `@nicoddemus`_ for the report and `@RonnyPfannschmidt`_ for the PR. 866 867 868* pytest no longer recognizes coroutine functions as yield tests (`#2129`_). 869 Thanks to `@malinoff`_ for the PR. 870 871* Plugins loaded by the ``PYTEST_PLUGINS`` environment variable are now automatically 872 considered for assertion rewriting (`#2185`_). 873 Thanks `@nicoddemus`_ for the PR. 874 875* Improve error message when pytest.warns fails (`#2150`_). The type(s) of the 876 expected warnings and the list of caught warnings is added to the 877 error message. Thanks `@lesteve`_ for the PR. 878 879* Fix ``pytester`` internal plugin to work correctly with latest versions of 880 ``zope.interface`` (`#1989`_). Thanks `@nicoddemus`_ for the PR. 881 882* Assert statements of the ``pytester`` plugin again benefit from assertion rewriting (`#1920`_). 883 Thanks `@RonnyPfannschmidt`_ for the report and `@nicoddemus`_ for the PR. 884 885* Specifying tests with colons like ``test_foo.py::test_bar`` for tests in 886 subdirectories with ini configuration files now uses the correct ini file 887 (`#2148`_). Thanks `@pelme`_. 888 889* Fail ``testdir.runpytest().assert_outcomes()`` explicitly if the pytest 890 terminal output it relies on is missing. Thanks to `@eli-b`_ for the PR. 891 892 893.. _@barneygale: https://github.com/barneygale 894.. _@lesteve: https://github.com/lesteve 895.. _@malinoff: https://github.com/malinoff 896.. _@pelme: https://github.com/pelme 897.. _@eli-b: https://github.com/eli-b 898 899.. _#2118: https://github.com/pytest-dev/pytest/issues/2118 900 901.. _#1989: https://github.com/pytest-dev/pytest/issues/1989 902.. _#1920: https://github.com/pytest-dev/pytest/issues/1920 903.. _#2129: https://github.com/pytest-dev/pytest/issues/2129 904.. _#2148: https://github.com/pytest-dev/pytest/issues/2148 905.. _#2150: https://github.com/pytest-dev/pytest/issues/2150 906.. _#2185: https://github.com/pytest-dev/pytest/issues/2185 907 908 9093.0.5 (2016-12-05) 910================== 911 912* Add warning when not passing ``option=value`` correctly to ``-o/--override-ini`` (`#2105`_). 913 Also improved the help documentation. Thanks to `@mbukatov`_ for the report and 914 `@lwm`_ for the PR. 915 916* Now ``--confcutdir`` and ``--junit-xml`` are properly validated if they are directories 917 and filenames, respectively (`#2089`_ and `#2078`_). Thanks to `@lwm`_ for the PR. 918 919* Add hint to error message hinting possible missing ``__init__.py`` (`#478`_). Thanks `@DuncanBetts`_. 920 921* More accurately describe when fixture finalization occurs in documentation (`#687`_). Thanks `@DuncanBetts`_. 922 923* Provide ``:ref:`` targets for ``recwarn.rst`` so we can use intersphinx referencing. 924 Thanks to `@dupuy`_ for the report and `@lwm`_ for the PR. 925 926* In Python 2, use a simple ``+-`` ASCII string in the string representation of ``pytest.approx`` (for example ``"4 +- 4.0e-06"``) 927 because it is brittle to handle that in different contexts and representations internally in pytest 928 which can result in bugs such as `#2111`_. In Python 3, the representation still uses ``±`` (for example ``4 ± 4.0e-06``). 929 Thanks `@kerrick-lyft`_ for the report and `@nicoddemus`_ for the PR. 930 931* Using ``item.Function``, ``item.Module``, etc., is now issuing deprecation warnings, prefer 932 ``pytest.Function``, ``pytest.Module``, etc., instead (`#2034`_). 933 Thanks `@nmundar`_ for the PR. 934 935* Fix error message using ``approx`` with complex numbers (`#2082`_). 936 Thanks `@adler-j`_ for the report and `@nicoddemus`_ for the PR. 937 938* Fixed false-positives warnings from assertion rewrite hook for modules imported more than 939 once by the ``pytest_plugins`` mechanism. 940 Thanks `@nicoddemus`_ for the PR. 941 942* Remove an internal cache which could cause hooks from ``conftest.py`` files in 943 sub-directories to be called in other directories incorrectly (`#2016`_). 944 Thanks `@d-b-w`_ for the report and `@nicoddemus`_ for the PR. 945 946* Remove internal code meant to support earlier Python 3 versions that produced the side effect 947 of leaving ``None`` in ``sys.modules`` when expressions were evaluated by pytest (for example passing a condition 948 as a string to ``pytest.mark.skipif``)(`#2103`_). 949 Thanks `@jaraco`_ for the report and `@nicoddemus`_ for the PR. 950 951* Cope gracefully with a .pyc file with no matching .py file (`#2038`_). Thanks 952 `@nedbat`_. 953 954.. _@syre: https://github.com/syre 955.. _@adler-j: https://github.com/adler-j 956.. _@d-b-w: https://bitbucket.org/d-b-w/ 957.. _@DuncanBetts: https://github.com/DuncanBetts 958.. _@dupuy: https://bitbucket.org/dupuy/ 959.. _@kerrick-lyft: https://github.com/kerrick-lyft 960.. _@lwm: https://github.com/lwm 961.. _@mbukatov: https://github.com/mbukatov 962.. _@nedbat: https://github.com/nedbat 963.. _@nmundar: https://github.com/nmundar 964 965.. _#2016: https://github.com/pytest-dev/pytest/issues/2016 966.. _#2034: https://github.com/pytest-dev/pytest/issues/2034 967.. _#2038: https://github.com/pytest-dev/pytest/issues/2038 968.. _#2078: https://github.com/pytest-dev/pytest/issues/2078 969.. _#2082: https://github.com/pytest-dev/pytest/issues/2082 970.. _#2089: https://github.com/pytest-dev/pytest/issues/2089 971.. _#2103: https://github.com/pytest-dev/pytest/issues/2103 972.. _#2105: https://github.com/pytest-dev/pytest/issues/2105 973.. _#2111: https://github.com/pytest-dev/pytest/issues/2111 974.. _#478: https://github.com/pytest-dev/pytest/issues/478 975.. _#687: https://github.com/pytest-dev/pytest/issues/687 976 977 9783.0.4 (2016-11-09) 979================== 980 981* Import errors when collecting test modules now display the full traceback (`#1976`_). 982 Thanks `@cwitty`_ for the report and `@nicoddemus`_ for the PR. 983 984* Fix confusing command-line help message for custom options with two or more ``metavar`` properties (`#2004`_). 985 Thanks `@okulynyak`_ and `@davehunt`_ for the report and `@nicoddemus`_ for the PR. 986 987* When loading plugins, import errors which contain non-ascii messages are now properly handled in Python 2 (`#1998`_). 988 Thanks `@nicoddemus`_ for the PR. 989 990* Fixed cyclic reference when ``pytest.raises`` is used in context-manager form (`#1965`_). Also as a 991 result of this fix, ``sys.exc_info()`` is left empty in both context-manager and function call usages. 992 Previously, ``sys.exc_info`` would contain the exception caught by the context manager, 993 even when the expected exception occurred. 994 Thanks `@MSeifert04`_ for the report and the PR. 995 996* Fixed false-positives warnings from assertion rewrite hook for modules that were rewritten but 997 were later marked explicitly by ``pytest.register_assert_rewrite`` 998 or implicitly as a plugin (`#2005`_). 999 Thanks `@RonnyPfannschmidt`_ for the report and `@nicoddemus`_ for the PR. 1000 1001* Report teardown output on test failure (`#442`_). 1002 Thanks `@matclab`_ for the PR. 1003 1004* Fix teardown error message in generated xUnit XML. 1005 Thanks `@gdyuldin`_ for the PR. 1006 1007* Properly handle exceptions in ``multiprocessing`` tasks (`#1984`_). 1008 Thanks `@adborden`_ for the report and `@nicoddemus`_ for the PR. 1009 1010* Clean up unittest TestCase objects after tests are complete (`#1649`_). 1011 Thanks `@d_b_w`_ for the report and PR. 1012 1013 1014.. _@adborden: https://github.com/adborden 1015.. _@cwitty: https://github.com/cwitty 1016.. _@d_b_w: https://github.com/d_b_w 1017.. _@gdyuldin: https://github.com/gdyuldin 1018.. _@matclab: https://github.com/matclab 1019.. _@MSeifert04: https://github.com/MSeifert04 1020.. _@okulynyak: https://github.com/okulynyak 1021 1022.. _#442: https://github.com/pytest-dev/pytest/issues/442 1023.. _#1965: https://github.com/pytest-dev/pytest/issues/1965 1024.. _#1976: https://github.com/pytest-dev/pytest/issues/1976 1025.. _#1984: https://github.com/pytest-dev/pytest/issues/1984 1026.. _#1998: https://github.com/pytest-dev/pytest/issues/1998 1027.. _#2004: https://github.com/pytest-dev/pytest/issues/2004 1028.. _#2005: https://github.com/pytest-dev/pytest/issues/2005 1029.. _#1649: https://github.com/pytest-dev/pytest/issues/1649 1030 1031 10323.0.3 (2016-09-28) 1033================== 1034 1035* The ``ids`` argument to ``parametrize`` again accepts ``unicode`` strings 1036 in Python 2 (`#1905`_). 1037 Thanks `@philpep`_ for the report and `@nicoddemus`_ for the PR. 1038 1039* Assertions are now being rewritten for plugins in development mode 1040 (``pip install -e``) (`#1934`_). 1041 Thanks `@nicoddemus`_ for the PR. 1042 1043* Fix pkg_resources import error in Jython projects (`#1853`_). 1044 Thanks `@raquel-ucl`_ for the PR. 1045 1046* Got rid of ``AttributeError: 'Module' object has no attribute '_obj'`` exception 1047 in Python 3 (`#1944`_). 1048 Thanks `@axil`_ for the PR. 1049 1050* Explain a bad scope value passed to ``@fixture`` declarations or 1051 a ``MetaFunc.parametrize()`` call. Thanks `@tgoodlet`_ for the PR. 1052 1053* This version includes ``pluggy-0.4.0``, which correctly handles 1054 ``VersionConflict`` errors in plugins (`#704`_). 1055 Thanks `@nicoddemus`_ for the PR. 1056 1057 1058.. _@philpep: https://github.com/philpep 1059.. _@raquel-ucl: https://github.com/raquel-ucl 1060.. _@axil: https://github.com/axil 1061.. _@tgoodlet: https://github.com/tgoodlet 1062.. _@vlad-dragos: https://github.com/vlad-dragos 1063 1064.. _#1853: https://github.com/pytest-dev/pytest/issues/1853 1065.. _#1905: https://github.com/pytest-dev/pytest/issues/1905 1066.. _#1934: https://github.com/pytest-dev/pytest/issues/1934 1067.. _#1944: https://github.com/pytest-dev/pytest/issues/1944 1068.. _#704: https://github.com/pytest-dev/pytest/issues/704 1069 1070 1071 1072 10733.0.2 (2016-09-01) 1074================== 1075 1076* Improve error message when passing non-string ids to ``pytest.mark.parametrize`` (`#1857`_). 1077 Thanks `@okken`_ for the report and `@nicoddemus`_ for the PR. 1078 1079* Add ``buffer`` attribute to stdin stub class ``pytest.capture.DontReadFromInput`` 1080 Thanks `@joguSD`_ for the PR. 1081 1082* Fix ``UnicodeEncodeError`` when string comparison with unicode has failed. (`#1864`_) 1083 Thanks `@AiOO`_ for the PR. 1084 1085* ``pytest_plugins`` is now handled correctly if defined as a string (as opposed as 1086 a sequence of strings) when modules are considered for assertion rewriting. 1087 Due to this bug, much more modules were being rewritten than necessary 1088 if a test suite uses ``pytest_plugins`` to load internal plugins (`#1888`_). 1089 Thanks `@jaraco`_ for the report and `@nicoddemus`_ for the PR (`#1891`_). 1090 1091* Do not call tearDown and cleanups when running tests from 1092 ``unittest.TestCase`` subclasses with ``--pdb`` 1093 enabled. This allows proper post mortem debugging for all applications 1094 which have significant logic in their tearDown machinery (`#1890`_). Thanks 1095 `@mbyt`_ for the PR. 1096 1097* Fix use of deprecated ``getfuncargvalue`` method in the internal doctest plugin. 1098 Thanks `@ViviCoder`_ for the report (`#1898`_). 1099 1100.. _@joguSD: https://github.com/joguSD 1101.. _@AiOO: https://github.com/AiOO 1102.. _@mbyt: https://github.com/mbyt 1103.. _@ViviCoder: https://github.com/ViviCoder 1104 1105.. _#1857: https://github.com/pytest-dev/pytest/issues/1857 1106.. _#1864: https://github.com/pytest-dev/pytest/issues/1864 1107.. _#1888: https://github.com/pytest-dev/pytest/issues/1888 1108.. _#1891: https://github.com/pytest-dev/pytest/pull/1891 1109.. _#1890: https://github.com/pytest-dev/pytest/issues/1890 1110.. _#1898: https://github.com/pytest-dev/pytest/issues/1898 1111 1112 11133.0.1 (2016-08-23) 1114================== 1115 1116* Fix regression when ``importorskip`` is used at module level (`#1822`_). 1117 Thanks `@jaraco`_ and `@The-Compiler`_ for the report and `@nicoddemus`_ for the PR. 1118 1119* Fix parametrization scope when session fixtures are used in conjunction 1120 with normal parameters in the same call (`#1832`_). 1121 Thanks `@The-Compiler`_ for the report, `@Kingdread`_ and `@nicoddemus`_ for the PR. 1122 1123* Fix internal error when parametrizing tests or fixtures using an empty ``ids`` argument (`#1849`_). 1124 Thanks `@OPpuolitaival`_ for the report and `@nicoddemus`_ for the PR. 1125 1126* Fix loader error when running ``pytest`` embedded in a zipfile. 1127 Thanks `@mbachry`_ for the PR. 1128 1129 1130.. _@Kingdread: https://github.com/Kingdread 1131.. _@mbachry: https://github.com/mbachry 1132.. _@OPpuolitaival: https://github.com/OPpuolitaival 1133 1134.. _#1822: https://github.com/pytest-dev/pytest/issues/1822 1135.. _#1832: https://github.com/pytest-dev/pytest/issues/1832 1136.. _#1849: https://github.com/pytest-dev/pytest/issues/1849 1137 1138 11393.0.0 (2016-08-18) 1140================== 1141 1142**Incompatible changes** 1143 1144 1145A number of incompatible changes were made in this release, with the intent of removing features deprecated for a long 1146time or change existing behaviors in order to make them less surprising/more useful. 1147 1148* Reinterpretation mode has now been removed. Only plain and rewrite 1149 mode are available, consequently the ``--assert=reinterp`` option is 1150 no longer available. This also means files imported from plugins or 1151 ``conftest.py`` will not benefit from improved assertions by 1152 default, you should use ``pytest.register_assert_rewrite()`` to 1153 explicitly turn on assertion rewriting for those files. Thanks 1154 `@flub`_ for the PR. 1155 1156* The following deprecated commandline options were removed: 1157 1158 * ``--genscript``: no longer supported; 1159 * ``--no-assert``: use ``--assert=plain`` instead; 1160 * ``--nomagic``: use ``--assert=plain`` instead; 1161 * ``--report``: use ``-r`` instead; 1162 1163 Thanks to `@RedBeardCode`_ for the PR (`#1664`_). 1164 1165* ImportErrors in plugins now are a fatal error instead of issuing a 1166 pytest warning (`#1479`_). Thanks to `@The-Compiler`_ for the PR. 1167 1168* Removed support code for Python 3 versions < 3.3 (`#1627`_). 1169 1170* Removed all ``py.test-X*`` entry points. The versioned, suffixed entry points 1171 were never documented and a leftover from a pre-virtualenv era. These entry 1172 points also created broken entry points in wheels, so removing them also 1173 removes a source of confusion for users (`#1632`_). 1174 Thanks `@obestwalter`_ for the PR. 1175 1176* ``pytest.skip()`` now raises an error when used to decorate a test function, 1177 as opposed to its original intent (to imperatively skip a test inside a test function). Previously 1178 this usage would cause the entire module to be skipped (`#607`_). 1179 Thanks `@omarkohl`_ for the complete PR (`#1519`_). 1180 1181* Exit tests if a collection error occurs. A poll indicated most users will hit CTRL-C 1182 anyway as soon as they see collection errors, so pytest might as well make that the default behavior (`#1421`_). 1183 A ``--continue-on-collection-errors`` option has been added to restore the previous behaviour. 1184 Thanks `@olegpidsadnyi`_ and `@omarkohl`_ for the complete PR (`#1628`_). 1185 1186* Renamed the pytest ``pdb`` module (plugin) into ``debugging`` to avoid clashes with the builtin ``pdb`` module. 1187 1188* Raise a helpful failure message when requesting a parametrized fixture at runtime, 1189 e.g. with ``request.getfixturevalue``. Previously these parameters were simply 1190 never defined, so a fixture decorated like ``@pytest.fixture(params=[0, 1, 2])`` 1191 only ran once (`#460`_). 1192 Thanks to `@nikratio`_ for the bug report, `@RedBeardCode`_ and `@tomviner`_ for the PR. 1193 1194* ``_pytest.monkeypatch.monkeypatch`` class has been renamed to ``_pytest.monkeypatch.MonkeyPatch`` 1195 so it doesn't conflict with the ``monkeypatch`` fixture. 1196 1197* ``--exitfirst / -x`` can now be overridden by a following ``--maxfail=N`` 1198 and is just a synonym for ``--maxfail=1``. 1199 1200 1201**New Features** 1202 1203* Support nose-style ``__test__`` attribute on methods of classes, 1204 including unittest-style Classes. If set to ``False``, the test will not be 1205 collected. 1206 1207* New ``doctest_namespace`` fixture for injecting names into the 1208 namespace in which doctests run. 1209 Thanks `@milliams`_ for the complete PR (`#1428`_). 1210 1211* New ``--doctest-report`` option available to change the output format of diffs 1212 when running (failing) doctests (implements `#1749`_). 1213 Thanks `@hartym`_ for the PR. 1214 1215* New ``name`` argument to ``pytest.fixture`` decorator which allows a custom name 1216 for a fixture (to solve the funcarg-shadowing-fixture problem). 1217 Thanks `@novas0x2a`_ for the complete PR (`#1444`_). 1218 1219* New ``approx()`` function for easily comparing floating-point numbers in 1220 tests. 1221 Thanks `@kalekundert`_ for the complete PR (`#1441`_). 1222 1223* Ability to add global properties in the final xunit output file by accessing 1224 the internal ``junitxml`` plugin (experimental). 1225 Thanks `@tareqalayan`_ for the complete PR `#1454`_). 1226 1227* New ``ExceptionInfo.match()`` method to match a regular expression on the 1228 string representation of an exception (`#372`_). 1229 Thanks `@omarkohl`_ for the complete PR (`#1502`_). 1230 1231* ``__tracebackhide__`` can now also be set to a callable which then can decide 1232 whether to filter the traceback based on the ``ExceptionInfo`` object passed 1233 to it. Thanks `@The-Compiler`_ for the complete PR (`#1526`_). 1234 1235* New ``pytest_make_parametrize_id(config, val)`` hook which can be used by plugins to provide 1236 friendly strings for custom types. 1237 Thanks `@palaviv`_ for the PR. 1238 1239* ``capsys`` and ``capfd`` now have a ``disabled()`` context-manager method, which 1240 can be used to temporarily disable capture within a test. 1241 Thanks `@nicoddemus`_ for the PR. 1242 1243* New cli flag ``--fixtures-per-test``: shows which fixtures are being used 1244 for each selected test item. Features doc strings of fixtures by default. 1245 Can also show where fixtures are defined if combined with ``-v``. 1246 Thanks `@hackebrot`_ for the PR. 1247 1248* Introduce ``pytest`` command as recommended entry point. Note that ``py.test`` 1249 still works and is not scheduled for removal. Closes proposal 1250 `#1629`_. Thanks `@obestwalter`_ and `@davehunt`_ for the complete PR 1251 (`#1633`_). 1252 1253* New cli flags: 1254 1255 + ``--setup-plan``: performs normal collection and reports 1256 the potential setup and teardown and does not execute any fixtures and tests; 1257 + ``--setup-only``: performs normal collection, executes setup and teardown of 1258 fixtures and reports them; 1259 + ``--setup-show``: performs normal test execution and additionally shows 1260 setup and teardown of fixtures; 1261 + ``--keep-duplicates``: py.test now ignores duplicated paths given in the command 1262 line. To retain the previous behavior where the same test could be run multiple 1263 times by specifying it in the command-line multiple times, pass the ``--keep-duplicates`` 1264 argument (`#1609`_); 1265 1266 Thanks `@d6e`_, `@kvas-it`_, `@sallner`_, `@ioggstream`_ and `@omarkohl`_ for the PRs. 1267 1268* New CLI flag ``--override-ini``/``-o``: overrides values from the ini file. 1269 For example: ``"-o xfail_strict=True"``'. 1270 Thanks `@blueyed`_ and `@fengxx`_ for the PR. 1271 1272* New hooks: 1273 1274 + ``pytest_fixture_setup(fixturedef, request)``: executes fixture setup; 1275 + ``pytest_fixture_post_finalizer(fixturedef)``: called after the fixture's 1276 finalizer and has access to the fixture's result cache. 1277 1278 Thanks `@d6e`_, `@sallner`_. 1279 1280* Issue warnings for asserts whose test is a tuple literal. Such asserts will 1281 never fail because tuples are always truthy and are usually a mistake 1282 (see `#1562`_). Thanks `@kvas-it`_, for the PR. 1283 1284* Allow passing a custom debugger class (e.g. ``--pdbcls=IPython.core.debugger:Pdb``). 1285 Thanks to `@anntzer`_ for the PR. 1286 1287 1288**Changes** 1289 1290* Plugins now benefit from assertion rewriting. Thanks 1291 `@sober7`_, `@nicoddemus`_ and `@flub`_ for the PR. 1292 1293* Change ``report.outcome`` for ``xpassed`` tests to ``"passed"`` in non-strict 1294 mode and ``"failed"`` in strict mode. Thanks to `@hackebrot`_ for the PR 1295 (`#1795`_) and `@gprasad84`_ for report (`#1546`_). 1296 1297* Tests marked with ``xfail(strict=False)`` (the default) now appear in 1298 JUnitXML reports as passing tests instead of skipped. 1299 Thanks to `@hackebrot`_ for the PR (`#1795`_). 1300 1301* Highlight path of the file location in the error report to make it easier to copy/paste. 1302 Thanks `@suzaku`_ for the PR (`#1778`_). 1303 1304* Fixtures marked with ``@pytest.fixture`` can now use ``yield`` statements exactly like 1305 those marked with the ``@pytest.yield_fixture`` decorator. This change renders 1306 ``@pytest.yield_fixture`` deprecated and makes ``@pytest.fixture`` with ``yield`` statements 1307 the preferred way to write teardown code (`#1461`_). 1308 Thanks `@csaftoiu`_ for bringing this to attention and `@nicoddemus`_ for the PR. 1309 1310* Explicitly passed parametrize ids do not get escaped to ascii (`#1351`_). 1311 Thanks `@ceridwen`_ for the PR. 1312 1313* Fixtures are now sorted in the error message displayed when an unknown 1314 fixture is declared in a test function. 1315 Thanks `@nicoddemus`_ for the PR. 1316 1317* ``pytest_terminal_summary`` hook now receives the ``exitstatus`` 1318 of the test session as argument. Thanks `@blueyed`_ for the PR (`#1809`_). 1319 1320* Parametrize ids can accept ``None`` as specific test id, in which case the 1321 automatically generated id for that argument will be used. 1322 Thanks `@palaviv`_ for the complete PR (`#1468`_). 1323 1324* The parameter to xunit-style setup/teardown methods (``setup_method``, 1325 ``setup_module``, etc.) is now optional and may be omitted. 1326 Thanks `@okken`_ for bringing this to attention and `@nicoddemus`_ for the PR. 1327 1328* Improved automatic id generation selection in case of duplicate ids in 1329 parametrize. 1330 Thanks `@palaviv`_ for the complete PR (`#1474`_). 1331 1332* Now pytest warnings summary is shown up by default. Added a new flag 1333 ``--disable-pytest-warnings`` to explicitly disable the warnings summary (`#1668`_). 1334 1335* Make ImportError during collection more explicit by reminding 1336 the user to check the name of the test module/package(s) (`#1426`_). 1337 Thanks `@omarkohl`_ for the complete PR (`#1520`_). 1338 1339* Add ``build/`` and ``dist/`` to the default ``--norecursedirs`` list. Thanks 1340 `@mikofski`_ for the report and `@tomviner`_ for the PR (`#1544`_). 1341 1342* ``pytest.raises`` in the context manager form accepts a custom 1343 ``message`` to raise when no exception occurred. 1344 Thanks `@palaviv`_ for the complete PR (`#1616`_). 1345 1346* ``conftest.py`` files now benefit from assertion rewriting; previously it 1347 was only available for test modules. Thanks `@flub`_, `@sober7`_ and 1348 `@nicoddemus`_ for the PR (`#1619`_). 1349 1350* Text documents without any doctests no longer appear as "skipped". 1351 Thanks `@graingert`_ for reporting and providing a full PR (`#1580`_). 1352 1353* Ensure that a module within a namespace package can be found when it 1354 is specified on the command line together with the ``--pyargs`` 1355 option. Thanks to `@taschini`_ for the PR (`#1597`_). 1356 1357* Always include full assertion explanation during assertion rewriting. The previous behaviour was hiding 1358 sub-expressions that happened to be ``False``, assuming this was redundant information. 1359 Thanks `@bagerard`_ for reporting (`#1503`_). Thanks to `@davehunt`_ and 1360 `@tomviner`_ for the PR. 1361 1362* ``OptionGroup.addoption()`` now checks if option names were already 1363 added before, to make it easier to track down issues like `#1618`_. 1364 Before, you only got exceptions later from ``argparse`` library, 1365 giving no clue about the actual reason for double-added options. 1366 1367* ``yield``-based tests are considered deprecated and will be removed in pytest-4.0. 1368 Thanks `@nicoddemus`_ for the PR. 1369 1370* ``[pytest]`` sections in ``setup.cfg`` files should now be named ``[tool:pytest]`` 1371 to avoid conflicts with other distutils commands (see `#567`_). ``[pytest]`` sections in 1372 ``pytest.ini`` or ``tox.ini`` files are supported and unchanged. 1373 Thanks `@nicoddemus`_ for the PR. 1374 1375* Using ``pytest_funcarg__`` prefix to declare fixtures is considered deprecated and will be 1376 removed in pytest-4.0 (`#1684`_). 1377 Thanks `@nicoddemus`_ for the PR. 1378 1379* Passing a command-line string to ``pytest.main()`` is considered deprecated and scheduled 1380 for removal in pytest-4.0. It is recommended to pass a list of arguments instead (`#1723`_). 1381 1382* Rename ``getfuncargvalue`` to ``getfixturevalue``. ``getfuncargvalue`` is 1383 still present but is now considered deprecated. Thanks to `@RedBeardCode`_ and `@tomviner`_ 1384 for the PR (`#1626`_). 1385 1386* ``optparse`` type usage now triggers DeprecationWarnings (`#1740`_). 1387 1388 1389* ``optparse`` backward compatibility supports float/complex types (`#457`_). 1390 1391* Refined logic for determining the ``rootdir``, considering only valid 1392 paths which fixes a number of issues: `#1594`_, `#1435`_ and `#1471`_. 1393 Updated the documentation according to current behavior. Thanks to 1394 `@blueyed`_, `@davehunt`_ and `@matthiasha`_ for the PR. 1395 1396* Always include full assertion explanation. The previous behaviour was hiding 1397 sub-expressions that happened to be False, assuming this was redundant information. 1398 Thanks `@bagerard`_ for reporting (`#1503`_). Thanks to `@davehunt`_ and 1399 `@tomviner`_ for PR. 1400 1401* Better message in case of not using parametrized variable (see `#1539`_). 1402 Thanks to `@tramwaj29`_ for the PR. 1403 1404* Updated docstrings with a more uniform style. 1405 1406* Add stderr write for ``pytest.exit(msg)`` during startup. Previously the message was never shown. 1407 Thanks `@BeyondEvil`_ for reporting `#1210`_. Thanks to `@JonathonSonesen`_ and 1408 `@tomviner`_ for the PR. 1409 1410* No longer display the incorrect test deselection reason (`#1372`_). 1411 Thanks `@ronnypfannschmidt`_ for the PR. 1412 1413* The ``--resultlog`` command line option has been deprecated: it is little used 1414 and there are more modern and better alternatives (see `#830`_). 1415 Thanks `@nicoddemus`_ for the PR. 1416 1417* Improve error message with fixture lookup errors: add an 'E' to the first 1418 line and '>' to the rest. Fixes `#717`_. Thanks `@blueyed`_ for reporting and 1419 a PR, `@eolo999`_ for the initial PR and `@tomviner`_ for his guidance during 1420 EuroPython2016 sprint. 1421 1422 1423**Bug Fixes** 1424 1425* Parametrize now correctly handles duplicated test ids. 1426 1427* Fix internal error issue when the ``method`` argument is missing for 1428 ``teardown_method()`` (`#1605`_). 1429 1430* Fix exception visualization in case the current working directory (CWD) gets 1431 deleted during testing (`#1235`_). Thanks `@bukzor`_ for reporting. PR by 1432 `@marscher`_. 1433 1434* Improve test output for logical expression with brackets (`#925`_). 1435 Thanks `@DRMacIver`_ for reporting and `@RedBeardCode`_ for the PR. 1436 1437* Create correct diff for strings ending with newlines (`#1553`_). 1438 Thanks `@Vogtinator`_ for reporting and `@RedBeardCode`_ and 1439 `@tomviner`_ for the PR. 1440 1441* ``ConftestImportFailure`` now shows the traceback making it easier to 1442 identify bugs in ``conftest.py`` files (`#1516`_). Thanks `@txomon`_ for 1443 the PR. 1444 1445* Text documents without any doctests no longer appear as "skipped". 1446 Thanks `@graingert`_ for reporting and providing a full PR (`#1580`_). 1447 1448* Fixed collection of classes with custom ``__new__`` method. 1449 Fixes `#1579`_. Thanks to `@Stranger6667`_ for the PR. 1450 1451* Fixed scope overriding inside metafunc.parametrize (`#634`_). 1452 Thanks to `@Stranger6667`_ for the PR. 1453 1454* Fixed the total tests tally in junit xml output (`#1798`_). 1455 Thanks to `@cryporchild`_ for the PR. 1456 1457* Fixed off-by-one error with lines from ``request.node.warn``. 1458 Thanks to `@blueyed`_ for the PR. 1459 1460 1461.. _#1210: https://github.com/pytest-dev/pytest/issues/1210 1462.. _#1235: https://github.com/pytest-dev/pytest/issues/1235 1463.. _#1351: https://github.com/pytest-dev/pytest/issues/1351 1464.. _#1372: https://github.com/pytest-dev/pytest/issues/1372 1465.. _#1421: https://github.com/pytest-dev/pytest/issues/1421 1466.. _#1426: https://github.com/pytest-dev/pytest/issues/1426 1467.. _#1428: https://github.com/pytest-dev/pytest/pull/1428 1468.. _#1435: https://github.com/pytest-dev/pytest/issues/1435 1469.. _#1441: https://github.com/pytest-dev/pytest/pull/1441 1470.. _#1444: https://github.com/pytest-dev/pytest/pull/1444 1471.. _#1454: https://github.com/pytest-dev/pytest/pull/1454 1472.. _#1461: https://github.com/pytest-dev/pytest/pull/1461 1473.. _#1468: https://github.com/pytest-dev/pytest/pull/1468 1474.. _#1471: https://github.com/pytest-dev/pytest/issues/1471 1475.. _#1474: https://github.com/pytest-dev/pytest/pull/1474 1476.. _#1479: https://github.com/pytest-dev/pytest/issues/1479 1477.. _#1502: https://github.com/pytest-dev/pytest/pull/1502 1478.. _#1503: https://github.com/pytest-dev/pytest/issues/1503 1479.. _#1516: https://github.com/pytest-dev/pytest/pull/1516 1480.. _#1519: https://github.com/pytest-dev/pytest/pull/1519 1481.. _#1520: https://github.com/pytest-dev/pytest/pull/1520 1482.. _#1526: https://github.com/pytest-dev/pytest/pull/1526 1483.. _#1539: https://github.com/pytest-dev/pytest/issues/1539 1484.. _#1544: https://github.com/pytest-dev/pytest/issues/1544 1485.. _#1546: https://github.com/pytest-dev/pytest/issues/1546 1486.. _#1553: https://github.com/pytest-dev/pytest/issues/1553 1487.. _#1562: https://github.com/pytest-dev/pytest/issues/1562 1488.. _#1579: https://github.com/pytest-dev/pytest/issues/1579 1489.. _#1580: https://github.com/pytest-dev/pytest/pull/1580 1490.. _#1594: https://github.com/pytest-dev/pytest/issues/1594 1491.. _#1597: https://github.com/pytest-dev/pytest/pull/1597 1492.. _#1605: https://github.com/pytest-dev/pytest/issues/1605 1493.. _#1616: https://github.com/pytest-dev/pytest/pull/1616 1494.. _#1618: https://github.com/pytest-dev/pytest/issues/1618 1495.. _#1619: https://github.com/pytest-dev/pytest/issues/1619 1496.. _#1626: https://github.com/pytest-dev/pytest/pull/1626 1497.. _#1627: https://github.com/pytest-dev/pytest/pull/1627 1498.. _#1628: https://github.com/pytest-dev/pytest/pull/1628 1499.. _#1629: https://github.com/pytest-dev/pytest/issues/1629 1500.. _#1632: https://github.com/pytest-dev/pytest/issues/1632 1501.. _#1633: https://github.com/pytest-dev/pytest/pull/1633 1502.. _#1664: https://github.com/pytest-dev/pytest/pull/1664 1503.. _#1668: https://github.com/pytest-dev/pytest/issues/1668 1504.. _#1684: https://github.com/pytest-dev/pytest/pull/1684 1505.. _#1723: https://github.com/pytest-dev/pytest/pull/1723 1506.. _#1740: https://github.com/pytest-dev/pytest/issues/1740 1507.. _#1749: https://github.com/pytest-dev/pytest/issues/1749 1508.. _#1778: https://github.com/pytest-dev/pytest/pull/1778 1509.. _#1795: https://github.com/pytest-dev/pytest/pull/1795 1510.. _#1798: https://github.com/pytest-dev/pytest/pull/1798 1511.. _#1809: https://github.com/pytest-dev/pytest/pull/1809 1512.. _#372: https://github.com/pytest-dev/pytest/issues/372 1513.. _#457: https://github.com/pytest-dev/pytest/issues/457 1514.. _#460: https://github.com/pytest-dev/pytest/pull/460 1515.. _#567: https://github.com/pytest-dev/pytest/pull/567 1516.. _#607: https://github.com/pytest-dev/pytest/issues/607 1517.. _#634: https://github.com/pytest-dev/pytest/issues/634 1518.. _#717: https://github.com/pytest-dev/pytest/issues/717 1519.. _#830: https://github.com/pytest-dev/pytest/issues/830 1520.. _#925: https://github.com/pytest-dev/pytest/issues/925 1521 1522 1523.. _@anntzer: https://github.com/anntzer 1524.. _@bagerard: https://github.com/bagerard 1525.. _@BeyondEvil: https://github.com/BeyondEvil 1526.. _@blueyed: https://github.com/blueyed 1527.. _@ceridwen: https://github.com/ceridwen 1528.. _@cryporchild: https://github.com/cryporchild 1529.. _@csaftoiu: https://github.com/csaftoiu 1530.. _@d6e: https://github.com/d6e 1531.. _@davehunt: https://github.com/davehunt 1532.. _@DRMacIver: https://github.com/DRMacIver 1533.. _@eolo999: https://github.com/eolo999 1534.. _@fengxx: https://github.com/fengxx 1535.. _@flub: https://github.com/flub 1536.. _@gprasad84: https://github.com/gprasad84 1537.. _@graingert: https://github.com/graingert 1538.. _@hartym: https://github.com/hartym 1539.. _@JonathonSonesen: https://github.com/JonathonSonesen 1540.. _@kalekundert: https://github.com/kalekundert 1541.. _@kvas-it: https://github.com/kvas-it 1542.. _@marscher: https://github.com/marscher 1543.. _@mikofski: https://github.com/mikofski 1544.. _@milliams: https://github.com/milliams 1545.. _@nikratio: https://github.com/nikratio 1546.. _@novas0x2a: https://github.com/novas0x2a 1547.. _@obestwalter: https://github.com/obestwalter 1548.. _@okken: https://github.com/okken 1549.. _@olegpidsadnyi: https://github.com/olegpidsadnyi 1550.. _@omarkohl: https://github.com/omarkohl 1551.. _@palaviv: https://github.com/palaviv 1552.. _@RedBeardCode: https://github.com/RedBeardCode 1553.. _@sallner: https://github.com/sallner 1554.. _@sober7: https://github.com/sober7 1555.. _@Stranger6667: https://github.com/Stranger6667 1556.. _@suzaku: https://github.com/suzaku 1557.. _@tareqalayan: https://github.com/tareqalayan 1558.. _@taschini: https://github.com/taschini 1559.. _@tramwaj29: https://github.com/tramwaj29 1560.. _@txomon: https://github.com/txomon 1561.. _@Vogtinator: https://github.com/Vogtinator 1562.. _@matthiasha: https://github.com/matthiasha 1563 1564 15652.9.2 (2016-05-31) 1566================== 1567 1568**Bug Fixes** 1569 1570* fix `#510`_: skip tests where one parameterize dimension was empty 1571 thanks Alex Stapleton for the Report and `@RonnyPfannschmidt`_ for the PR 1572 1573* Fix Xfail does not work with condition keyword argument. 1574 Thanks `@astraw38`_ for reporting the issue (`#1496`_) and `@tomviner`_ 1575 for PR the (`#1524`_). 1576 1577* Fix win32 path issue when putting custom config file with absolute path 1578 in ``pytest.main("-c your_absolute_path")``. 1579 1580* Fix maximum recursion depth detection when raised error class is not aware 1581 of unicode/encoded bytes. 1582 Thanks `@prusse-martin`_ for the PR (`#1506`_). 1583 1584* Fix ``pytest.mark.skip`` mark when used in strict mode. 1585 Thanks `@pquentin`_ for the PR and `@RonnyPfannschmidt`_ for 1586 showing how to fix the bug. 1587 1588* Minor improvements and fixes to the documentation. 1589 Thanks `@omarkohl`_ for the PR. 1590 1591* Fix ``--fixtures`` to show all fixture definitions as opposed to just 1592 one per fixture name. 1593 Thanks to `@hackebrot`_ for the PR. 1594 1595.. _#510: https://github.com/pytest-dev/pytest/issues/510 1596.. _#1506: https://github.com/pytest-dev/pytest/pull/1506 1597.. _#1496: https://github.com/pytest-dev/pytest/issues/1496 1598.. _#1524: https://github.com/pytest-dev/pytest/pull/1524 1599 1600.. _@prusse-martin: https://github.com/prusse-martin 1601.. _@astraw38: https://github.com/astraw38 1602 1603 16042.9.1 (2016-03-17) 1605================== 1606 1607**Bug Fixes** 1608 1609* Improve error message when a plugin fails to load. 1610 Thanks `@nicoddemus`_ for the PR. 1611 1612* Fix (`#1178 <https://github.com/pytest-dev/pytest/issues/1178>`_): 1613 ``pytest.fail`` with non-ascii characters raises an internal pytest error. 1614 Thanks `@nicoddemus`_ for the PR. 1615 1616* Fix (`#469`_): junit parses report.nodeid incorrectly, when params IDs 1617 contain ``::``. Thanks `@tomviner`_ for the PR (`#1431`_). 1618 1619* Fix (`#578 <https://github.com/pytest-dev/pytest/issues/578>`_): SyntaxErrors 1620 containing non-ascii lines at the point of failure generated an internal 1621 py.test error. 1622 Thanks `@asottile`_ for the report and `@nicoddemus`_ for the PR. 1623 1624* Fix (`#1437`_): When passing in a bytestring regex pattern to parameterize 1625 attempt to decode it as utf-8 ignoring errors. 1626 1627* Fix (`#649`_): parametrized test nodes cannot be specified to run on the command line. 1628 1629* Fix (`#138`_): better reporting for python 3.3+ chained exceptions 1630 1631.. _#1437: https://github.com/pytest-dev/pytest/issues/1437 1632.. _#469: https://github.com/pytest-dev/pytest/issues/469 1633.. _#1431: https://github.com/pytest-dev/pytest/pull/1431 1634.. _#649: https://github.com/pytest-dev/pytest/issues/649 1635.. _#138: https://github.com/pytest-dev/pytest/issues/138 1636 1637.. _@asottile: https://github.com/asottile 1638 1639 16402.9.0 (2016-02-29) 1641================== 1642 1643**New Features** 1644 1645* New ``pytest.mark.skip`` mark, which unconditionally skips marked tests. 1646 Thanks `@MichaelAquilina`_ for the complete PR (`#1040`_). 1647 1648* ``--doctest-glob`` may now be passed multiple times in the command-line. 1649 Thanks `@jab`_ and `@nicoddemus`_ for the PR. 1650 1651* New ``-rp`` and ``-rP`` reporting options give the summary and full output 1652 of passing tests, respectively. Thanks to `@codewarrior0`_ for the PR. 1653 1654* ``pytest.mark.xfail`` now has a ``strict`` option, which makes ``XPASS`` 1655 tests to fail the test suite (defaulting to ``False``). There's also a 1656 ``xfail_strict`` ini option that can be used to configure it project-wise. 1657 Thanks `@rabbbit`_ for the request and `@nicoddemus`_ for the PR (`#1355`_). 1658 1659* ``Parser.addini`` now supports options of type ``bool``. 1660 Thanks `@nicoddemus`_ for the PR. 1661 1662* New ``ALLOW_BYTES`` doctest option. This strips ``b`` prefixes from byte strings 1663 in doctest output (similar to ``ALLOW_UNICODE``). 1664 Thanks `@jaraco`_ for the request and `@nicoddemus`_ for the PR (`#1287`_). 1665 1666* Give a hint on ``KeyboardInterrupt`` to use the ``--fulltrace`` option to show the errors. 1667 Fixes `#1366`_. 1668 Thanks to `@hpk42`_ for the report and `@RonnyPfannschmidt`_ for the PR. 1669 1670* Catch ``IndexError`` exceptions when getting exception source location. 1671 Fixes a pytest internal error for dynamically generated code (fixtures and tests) 1672 where source lines are fake by intention. 1673 1674**Changes** 1675 1676* **Important**: `py.code <https://pylib.readthedocs.io/en/latest/code.html>`_ has been 1677 merged into the ``pytest`` repository as ``pytest._code``. This decision 1678 was made because ``py.code`` had very few uses outside ``pytest`` and the 1679 fact that it was in a different repository made it difficult to fix bugs on 1680 its code in a timely manner. The team hopes with this to be able to better 1681 refactor out and improve that code. 1682 This change shouldn't affect users, but it is useful to let users aware 1683 if they encounter any strange behavior. 1684 1685 Keep in mind that the code for ``pytest._code`` is **private** and 1686 **experimental**, so you definitely should not import it explicitly! 1687 1688 Please note that the original ``py.code`` is still available in 1689 `pylib <https://pylib.readthedocs.io>`_. 1690 1691* ``pytest_enter_pdb`` now optionally receives the pytest config object. 1692 Thanks `@nicoddemus`_ for the PR. 1693 1694* Removed code and documentation for Python 2.5 or lower versions, 1695 including removal of the obsolete ``_pytest.assertion.oldinterpret`` module. 1696 Thanks `@nicoddemus`_ for the PR (`#1226`_). 1697 1698* Comparisons now always show up in full when ``CI`` or ``BUILD_NUMBER`` is 1699 found in the environment, even when ``-vv`` isn't used. 1700 Thanks `@The-Compiler`_ for the PR. 1701 1702* ``--lf`` and ``--ff`` now support long names: ``--last-failed`` and 1703 ``--failed-first`` respectively. 1704 Thanks `@MichaelAquilina`_ for the PR. 1705 1706* Added expected exceptions to ``pytest.raises`` fail message. 1707 1708* Collection only displays progress ("collecting X items") when in a terminal. 1709 This avoids cluttering the output when using ``--color=yes`` to obtain 1710 colors in CI integrations systems (`#1397`_). 1711 1712**Bug Fixes** 1713 1714* The ``-s`` and ``-c`` options should now work under ``xdist``; 1715 ``Config.fromdictargs`` now represents its input much more faithfully. 1716 Thanks to `@bukzor`_ for the complete PR (`#680`_). 1717 1718* Fix (`#1290`_): support Python 3.5's ``@`` operator in assertion rewriting. 1719 Thanks `@Shinkenjoe`_ for report with test case and `@tomviner`_ for the PR. 1720 1721* Fix formatting utf-8 explanation messages (`#1379`_). 1722 Thanks `@biern`_ for the PR. 1723 1724* Fix `traceback style docs`_ to describe all of the available options 1725 (auto/long/short/line/native/no), with ``auto`` being the default since v2.6. 1726 Thanks `@hackebrot`_ for the PR. 1727 1728* Fix (`#1422`_): junit record_xml_property doesn't allow multiple records 1729 with same name. 1730 1731.. _`traceback style docs`: https://pytest.org/latest/usage.html#modifying-python-traceback-printing 1732 1733.. _#1609: https://github.com/pytest-dev/pytest/issues/1609 1734.. _#1422: https://github.com/pytest-dev/pytest/issues/1422 1735.. _#1379: https://github.com/pytest-dev/pytest/issues/1379 1736.. _#1366: https://github.com/pytest-dev/pytest/issues/1366 1737.. _#1040: https://github.com/pytest-dev/pytest/pull/1040 1738.. _#680: https://github.com/pytest-dev/pytest/issues/680 1739.. _#1287: https://github.com/pytest-dev/pytest/pull/1287 1740.. _#1226: https://github.com/pytest-dev/pytest/pull/1226 1741.. _#1290: https://github.com/pytest-dev/pytest/pull/1290 1742.. _#1355: https://github.com/pytest-dev/pytest/pull/1355 1743.. _#1397: https://github.com/pytest-dev/pytest/issues/1397 1744.. _@biern: https://github.com/biern 1745.. _@MichaelAquilina: https://github.com/MichaelAquilina 1746.. _@bukzor: https://github.com/bukzor 1747.. _@hpk42: https://github.com/hpk42 1748.. _@nicoddemus: https://github.com/nicoddemus 1749.. _@jab: https://github.com/jab 1750.. _@codewarrior0: https://github.com/codewarrior0 1751.. _@jaraco: https://github.com/jaraco 1752.. _@The-Compiler: https://github.com/The-Compiler 1753.. _@Shinkenjoe: https://github.com/Shinkenjoe 1754.. _@tomviner: https://github.com/tomviner 1755.. _@RonnyPfannschmidt: https://github.com/RonnyPfannschmidt 1756.. _@rabbbit: https://github.com/rabbbit 1757.. _@hackebrot: https://github.com/hackebrot 1758.. _@pquentin: https://github.com/pquentin 1759.. _@ioggstream: https://github.com/ioggstream 1760 17612.8.7 (2016-01-24) 1762================== 1763 1764- fix #1338: use predictable object resolution for monkeypatch 1765 17662.8.6 (2016-01-21) 1767================== 1768 1769- fix #1259: allow for double nodeids in junitxml, 1770 this was a regression failing plugins combinations 1771 like pytest-pep8 + pytest-flakes 1772 1773- Workaround for exception that occurs in pyreadline when using 1774 ``--pdb`` with standard I/O capture enabled. 1775 Thanks Erik M. Bray for the PR. 1776 1777- fix #900: Better error message in case the target of a ``monkeypatch`` call 1778 raises an ``ImportError``. 1779 1780- fix #1292: monkeypatch calls (setattr, setenv, etc.) are now O(1). 1781 Thanks David R. MacIver for the report and Bruno Oliveira for the PR. 1782 1783- fix #1223: captured stdout and stderr are now properly displayed before 1784 entering pdb when ``--pdb`` is used instead of being thrown away. 1785 Thanks Cal Leeming for the PR. 1786 1787- fix #1305: pytest warnings emitted during ``pytest_terminal_summary`` are now 1788 properly displayed. 1789 Thanks Ionel Maries Cristian for the report and Bruno Oliveira for the PR. 1790 1791- fix #628: fixed internal UnicodeDecodeError when doctests contain unicode. 1792 Thanks Jason R. Coombs for the report and Bruno Oliveira for the PR. 1793 1794- fix #1334: Add captured stdout to jUnit XML report on setup error. 1795 Thanks Georgy Dyuldin for the PR. 1796 1797 17982.8.5 (2015-12-11) 1799================== 1800 1801- fix #1243: fixed issue where class attributes injected during collection could break pytest. 1802 PR by Alexei Kozlenok, thanks Ronny Pfannschmidt and Bruno Oliveira for the review and help. 1803 1804- fix #1074: precompute junitxml chunks instead of storing the whole tree in objects 1805 Thanks Bruno Oliveira for the report and Ronny Pfannschmidt for the PR 1806 1807- fix #1238: fix ``pytest.deprecated_call()`` receiving multiple arguments 1808 (Regression introduced in 2.8.4). Thanks Alex Gaynor for the report and 1809 Bruno Oliveira for the PR. 1810 1811 18122.8.4 (2015-12-06) 1813================== 1814 1815- fix #1190: ``deprecated_call()`` now works when the deprecated 1816 function has been already called by another test in the same 1817 module. Thanks Mikhail Chernykh for the report and Bruno Oliveira for the 1818 PR. 1819 1820- fix #1198: ``--pastebin`` option now works on Python 3. Thanks 1821 Mehdy Khoshnoody for the PR. 1822 1823- fix #1219: ``--pastebin`` now works correctly when captured output contains 1824 non-ascii characters. Thanks Bruno Oliveira for the PR. 1825 1826- fix #1204: another error when collecting with a nasty __getattr__(). 1827 Thanks Florian Bruhin for the PR. 1828 1829- fix the summary printed when no tests did run. 1830 Thanks Florian Bruhin for the PR. 1831- fix #1185 - ensure MANIFEST.in exactly matches what should go to a sdist 1832 1833- a number of documentation modernizations wrt good practices. 1834 Thanks Bruno Oliveira for the PR. 1835 18362.8.3 (2015-11-18) 1837================== 1838 1839- fix #1169: add __name__ attribute to testcases in TestCaseFunction to 1840 support the @unittest.skip decorator on functions and methods. 1841 Thanks Lee Kamentsky for the PR. 1842 1843- fix #1035: collecting tests if test module level obj has __getattr__(). 1844 Thanks Suor for the report and Bruno Oliveira / Tom Viner for the PR. 1845 1846- fix #331: don't collect tests if their failure cannot be reported correctly 1847 e.g. they are a callable instance of a class. 1848 1849- fix #1133: fixed internal error when filtering tracebacks where one entry 1850 belongs to a file which is no longer available. 1851 Thanks Bruno Oliveira for the PR. 1852 1853- enhancement made to highlight in red the name of the failing tests so 1854 they stand out in the output. 1855 Thanks Gabriel Reis for the PR. 1856 1857- add more talks to the documentation 1858- extend documentation on the --ignore cli option 1859- use pytest-runner for setuptools integration 1860- minor fixes for interaction with OS X El Capitan 1861 system integrity protection (thanks Florian) 1862 1863 18642.8.2 (2015-10-07) 1865================== 1866 1867- fix #1085: proper handling of encoding errors when passing encoded byte 1868 strings to pytest.parametrize in Python 2. 1869 Thanks Themanwithoutaplan for the report and Bruno Oliveira for the PR. 1870 1871- fix #1087: handling SystemError when passing empty byte strings to 1872 pytest.parametrize in Python 3. 1873 Thanks Paul Kehrer for the report and Bruno Oliveira for the PR. 1874 1875- fix #995: fixed internal error when filtering tracebacks where one entry 1876 was generated by an exec() statement. 1877 Thanks Daniel Hahler, Ashley C Straw, Philippe Gauthier and Pavel Savchenko 1878 for contributing and Bruno Oliveira for the PR. 1879 1880- fix #1100 and #1057: errors when using autouse fixtures and doctest modules. 1881 Thanks Sergey B Kirpichev and Vital Kudzelka for contributing and Bruno 1882 Oliveira for the PR. 1883 18842.8.1 (2015-09-29) 1885================== 1886 1887- fix #1034: Add missing nodeid on pytest_logwarning call in 1888 addhook. Thanks Simon Gomizelj for the PR. 1889 1890- 'deprecated_call' is now only satisfied with a DeprecationWarning or 1891 PendingDeprecationWarning. Before 2.8.0, it accepted any warning, and 2.8.0 1892 made it accept only DeprecationWarning (but not PendingDeprecationWarning). 1893 Thanks Alex Gaynor for the issue and Eric Hunsberger for the PR. 1894 1895- fix issue #1073: avoid calling __getattr__ on potential plugin objects. 1896 This fixes an incompatibility with pytest-django. Thanks Andreas Pelme, 1897 Bruno Oliveira and Ronny Pfannschmidt for contributing and Holger Krekel 1898 for the fix. 1899 1900- Fix issue #704: handle versionconflict during plugin loading more 1901 gracefully. Thanks Bruno Oliveira for the PR. 1902 1903- Fix issue #1064: ""--junitxml" regression when used with the 1904 "pytest-xdist" plugin, with test reports being assigned to the wrong tests. 1905 Thanks Daniel Grunwald for the report and Bruno Oliveira for the PR. 1906 1907- (experimental) adapt more SEMVER style versioning and change meaning of 1908 master branch in git repo: "master" branch now keeps the bugfixes, changes 1909 aimed for micro releases. "features" branch will only be released 1910 with minor or major pytest releases. 1911 1912- Fix issue #766 by removing documentation references to distutils. 1913 Thanks Russel Winder. 1914 1915- Fix issue #1030: now byte-strings are escaped to produce item node ids 1916 to make them always serializable. 1917 Thanks Andy Freeland for the report and Bruno Oliveira for the PR. 1918 1919- Python 2: if unicode parametrized values are convertible to ascii, their 1920 ascii representation is used for the node id. 1921 1922- Fix issue #411: Add __eq__ method to assertion comparison example. 1923 Thanks Ben Webb. 1924- Fix issue #653: deprecated_call can be used as context manager. 1925 1926- fix issue 877: properly handle assertion explanations with non-ascii repr 1927 Thanks Mathieu Agopian for the report and Ronny Pfannschmidt for the PR. 1928 1929- fix issue 1029: transform errors when writing cache values into pytest-warnings 1930 19312.8.0 (2015-09-18) 1932================== 1933 1934- new ``--lf`` and ``-ff`` options to run only the last failing tests or 1935 "failing tests first" from the last run. This functionality is provided 1936 through porting the formerly external pytest-cache plugin into pytest core. 1937 BACKWARD INCOMPAT: if you used pytest-cache's functionality to persist 1938 data between test runs be aware that we don't serialize sets anymore. 1939 Thanks Ronny Pfannschmidt for most of the merging work. 1940 1941- "-r" option now accepts "a" to include all possible reports, similar 1942 to passing "fEsxXw" explicitly (isse960). 1943 Thanks Abhijeet Kasurde for the PR. 1944 1945- avoid python3.5 deprecation warnings by introducing version 1946 specific inspection helpers, thanks Michael Droettboom. 1947 1948- fix issue562: @nose.tools.istest now fully respected. 1949 1950- fix issue934: when string comparison fails and a diff is too large to display 1951 without passing -vv, still show a few lines of the diff. 1952 Thanks Florian Bruhin for the report and Bruno Oliveira for the PR. 1953 1954- fix issue736: Fix a bug where fixture params would be discarded when combined 1955 with parametrization markers. 1956 Thanks to Markus Unterwaditzer for the PR. 1957 1958- fix issue710: introduce ALLOW_UNICODE doctest option: when enabled, the 1959 ``u`` prefix is stripped from unicode strings in expected doctest output. This 1960 allows doctests which use unicode to run in Python 2 and 3 unchanged. 1961 Thanks Jason R. Coombs for the report and Bruno Oliveira for the PR. 1962 1963- parametrize now also generates meaningful test IDs for enum, regex and class 1964 objects (as opposed to class instances). 1965 Thanks to Florian Bruhin for the PR. 1966 1967- Add 'warns' to assert that warnings are thrown (like 'raises'). 1968 Thanks to Eric Hunsberger for the PR. 1969 1970- Fix issue683: Do not apply an already applied mark. Thanks ojake for the PR. 1971 1972- Deal with capturing failures better so fewer exceptions get lost to 1973 /dev/null. Thanks David Szotten for the PR. 1974 1975- fix issue730: deprecate and warn about the --genscript option. 1976 Thanks Ronny Pfannschmidt for the report and Christian Pommranz for the PR. 1977 1978- fix issue751: multiple parametrize with ids bug if it parametrizes class with 1979 two or more test methods. Thanks Sergey Chipiga for reporting and Jan 1980 Bednarik for PR. 1981 1982- fix issue82: avoid loading conftest files from setup.cfg/pytest.ini/tox.ini 1983 files and upwards by default (--confcutdir can still be set to override this). 1984 Thanks Bruno Oliveira for the PR. 1985 1986- fix issue768: docstrings found in python modules were not setting up session 1987 fixtures. Thanks Jason R. Coombs for reporting and Bruno Oliveira for the PR. 1988 1989- added ``tmpdir_factory``, a session-scoped fixture that can be used to create 1990 directories under the base temporary directory. Previously this object was 1991 installed as a ``_tmpdirhandler`` attribute of the ``config`` object, but now it 1992 is part of the official API and using ``config._tmpdirhandler`` is 1993 deprecated. 1994 Thanks Bruno Oliveira for the PR. 1995 1996- fix issue808: pytest's internal assertion rewrite hook now implements the 1997 optional PEP302 get_data API so tests can access data files next to them. 1998 Thanks xmo-odoo for request and example and Bruno Oliveira for 1999 the PR. 2000 2001- rootdir and inifile are now displayed during usage errors to help 2002 users diagnose problems such as unexpected ini files which add 2003 unknown options being picked up by pytest. Thanks to Pavel Savchenko for 2004 bringing the problem to attention in #821 and Bruno Oliveira for the PR. 2005 2006- Summary bar now is colored yellow for warning 2007 situations such as: all tests either were skipped or xpass/xfailed, 2008 or no tests were run at all (this is a partial fix for issue500). 2009 2010- fix issue812: pytest now exits with status code 5 in situations where no 2011 tests were run at all, such as the directory given in the command line does 2012 not contain any tests or as result of a command line option filters 2013 all out all tests (-k for example). 2014 Thanks Eric Siegerman (issue812) and Bruno Oliveira for the PR. 2015 2016- Summary bar now is colored yellow for warning 2017 situations such as: all tests either were skipped or xpass/xfailed, 2018 or no tests were run at all (related to issue500). 2019 Thanks Eric Siegerman. 2020 2021- New ``testpaths`` ini option: list of directories to search for tests 2022 when executing pytest from the root directory. This can be used 2023 to speed up test collection when a project has well specified directories 2024 for tests, being usually more practical than configuring norecursedirs for 2025 all directories that do not contain tests. 2026 Thanks to Adrian for idea (#694) and Bruno Oliveira for the PR. 2027 2028- fix issue713: JUnit XML reports for doctest failures. 2029 Thanks Punyashloka Biswal. 2030 2031- fix issue970: internal pytest warnings now appear as "pytest-warnings" in 2032 the terminal instead of "warnings", so it is clear for users that those 2033 warnings are from pytest and not from the builtin "warnings" module. 2034 Thanks Bruno Oliveira. 2035 2036- Include setup and teardown in junitxml test durations. 2037 Thanks Janne Vanhala. 2038 2039- fix issue735: assertion failures on debug versions of Python 3.4+ 2040 2041- new option ``--import-mode`` to allow to change test module importing 2042 behaviour to append to sys.path instead of prepending. This better allows 2043 to run test modules against installed versions of a package even if the 2044 package under test has the same import root. In this example:: 2045 2046 testing/__init__.py 2047 testing/test_pkg_under_test.py 2048 pkg_under_test/ 2049 2050 the tests will run against the installed version 2051 of pkg_under_test when ``--import-mode=append`` is used whereas 2052 by default they would always pick up the local version. Thanks Holger Krekel. 2053 2054- pytester: add method ``TmpTestdir.delete_loaded_modules()``, and call it 2055 from ``inline_run()`` to allow temporary modules to be reloaded. 2056 Thanks Eduardo Schettino. 2057 2058- internally refactor pluginmanager API and code so that there 2059 is a clear distinction between a pytest-agnostic rather simple 2060 pluginmanager and the PytestPluginManager which adds a lot of 2061 behaviour, among it handling of the local conftest files. 2062 In terms of documented methods this is a backward compatible 2063 change but it might still break 3rd party plugins which relied on 2064 details like especially the pluginmanager.add_shutdown() API. 2065 Thanks Holger Krekel. 2066 2067- pluginmanagement: introduce ``pytest.hookimpl`` and 2068 ``pytest.hookspec`` decorators for setting impl/spec 2069 specific parameters. This substitutes the previous 2070 now deprecated use of ``pytest.mark`` which is meant to 2071 contain markers for test functions only. 2072 2073- write/refine docs for "writing plugins" which now have their 2074 own page and are separate from the "using/installing plugins`` page. 2075 2076- fix issue732: properly unregister plugins from any hook calling 2077 sites allowing to have temporary plugins during test execution. 2078 2079- deprecate and warn about ``__multicall__`` argument in hook 2080 implementations. Use the ``hookwrapper`` mechanism instead already 2081 introduced with pytest-2.7. 2082 2083- speed up pytest's own test suite considerably by using inprocess 2084 tests by default (testrun can be modified with --runpytest=subprocess 2085 to create subprocesses in many places instead). The main 2086 APIs to run pytest in a test is "runpytest()" or "runpytest_subprocess" 2087 and "runpytest_inprocess" if you need a particular way of running 2088 the test. In all cases you get back a RunResult but the inprocess 2089 one will also have a "reprec" attribute with the recorded events/reports. 2090 2091- fix monkeypatch.setattr("x.y", raising=False) to actually not raise 2092 if "y" is not a pre-existing attribute. Thanks Florian Bruhin. 2093 2094- fix issue741: make running output from testdir.run copy/pasteable 2095 Thanks Bruno Oliveira. 2096 2097- add a new ``--noconftest`` argument which ignores all ``conftest.py`` files. 2098 2099- add ``file`` and ``line`` attributes to JUnit-XML output. 2100 2101- fix issue890: changed extension of all documentation files from ``txt`` to 2102 ``rst``. Thanks to Abhijeet for the PR. 2103 2104- fix issue714: add ability to apply indirect=True parameter on particular argnames. 2105 Thanks Elizaveta239. 2106 2107- fix issue890: changed extension of all documentation files from ``txt`` to 2108 ``rst``. Thanks to Abhijeet for the PR. 2109 2110- fix issue957: "# doctest: SKIP" option will now register doctests as SKIPPED 2111 rather than PASSED. 2112 Thanks Thomas Grainger for the report and Bruno Oliveira for the PR. 2113 2114- issue951: add new record_xml_property fixture, that supports logging 2115 additional information on xml output. Thanks David Diaz for the PR. 2116 2117- issue949: paths after normal options (for example ``-s``, ``-v``, etc) are now 2118 properly used to discover ``rootdir`` and ``ini`` files. 2119 Thanks Peter Lauri for the report and Bruno Oliveira for the PR. 2120 21212.7.3 (2015-09-15) 2122================== 2123 2124- Allow 'dev', 'rc', or other non-integer version strings in ``importorskip``. 2125 Thanks to Eric Hunsberger for the PR. 2126 2127- fix issue856: consider --color parameter in all outputs (for example 2128 --fixtures). Thanks Barney Gale for the report and Bruno Oliveira for the PR. 2129 2130- fix issue855: passing str objects as ``plugins`` argument to pytest.main 2131 is now interpreted as a module name to be imported and registered as a 2132 plugin, instead of silently having no effect. 2133 Thanks xmo-odoo for the report and Bruno Oliveira for the PR. 2134 2135- fix issue744: fix for ast.Call changes in Python 3.5+. Thanks 2136 Guido van Rossum, Matthias Bussonnier, Stefan Zimmermann and 2137 Thomas Kluyver. 2138 2139- fix issue842: applying markers in classes no longer propagate this markers 2140 to superclasses which also have markers. 2141 Thanks xmo-odoo for the report and Bruno Oliveira for the PR. 2142 2143- preserve warning functions after call to pytest.deprecated_call. Thanks 2144 Pieter Mulder for PR. 2145 2146- fix issue854: autouse yield_fixtures defined as class members of 2147 unittest.TestCase subclasses now work as expected. 2148 Thannks xmo-odoo for the report and Bruno Oliveira for the PR. 2149 2150- fix issue833: --fixtures now shows all fixtures of collected test files, instead of just the 2151 fixtures declared on the first one. 2152 Thanks Florian Bruhin for reporting and Bruno Oliveira for the PR. 2153 2154- fix issue863: skipped tests now report the correct reason when a skip/xfail 2155 condition is met when using multiple markers. 2156 Thanks Raphael Pierzina for reporting and Bruno Oliveira for the PR. 2157 2158- optimized tmpdir fixture initialization, which should make test sessions 2159 faster (specially when using pytest-xdist). The only visible effect 2160 is that now pytest uses a subdirectory in the $TEMP directory for all 2161 directories created by this fixture (defaults to $TEMP/pytest-$USER). 2162 Thanks Bruno Oliveira for the PR. 2163 21642.7.2 (2015-06-23) 2165================== 2166 2167- fix issue767: pytest.raises value attribute does not contain the exception 2168 instance on Python 2.6. Thanks Eric Siegerman for providing the test 2169 case and Bruno Oliveira for PR. 2170 2171- Automatically create directory for junitxml and results log. 2172 Thanks Aron Curzon. 2173 2174- fix issue713: JUnit XML reports for doctest failures. 2175 Thanks Punyashloka Biswal. 2176 2177- fix issue735: assertion failures on debug versions of Python 3.4+ 2178 Thanks Benjamin Peterson. 2179 2180- fix issue114: skipif marker reports to internal skipping plugin; 2181 Thanks Floris Bruynooghe for reporting and Bruno Oliveira for the PR. 2182 2183- fix issue748: unittest.SkipTest reports to internal pytest unittest plugin. 2184 Thanks Thomas De Schampheleire for reporting and Bruno Oliveira for the PR. 2185 2186- fix issue718: failed to create representation of sets containing unsortable 2187 elements in python 2. Thanks Edison Gustavo Muenz. 2188 2189- fix issue756, fix issue752 (and similar issues): depend on py-1.4.29 2190 which has a refined algorithm for traceback generation. 2191 2192 21932.7.1 (2015-05-19) 2194================== 2195 2196- fix issue731: do not get confused by the braces which may be present 2197 and unbalanced in an object's repr while collapsing False 2198 explanations. Thanks Carl Meyer for the report and test case. 2199 2200- fix issue553: properly handling inspect.getsourcelines failures in 2201 FixtureLookupError which would lead to an internal error, 2202 obfuscating the original problem. Thanks talljosh for initial 2203 diagnose/patch and Bruno Oliveira for final patch. 2204 2205- fix issue660: properly report scope-mismatch-access errors 2206 independently from ordering of fixture arguments. Also 2207 avoid the pytest internal traceback which does not provide 2208 information to the user. Thanks Holger Krekel. 2209 2210- streamlined and documented release process. Also all versions 2211 (in setup.py and documentation generation) are now read 2212 from _pytest/__init__.py. Thanks Holger Krekel. 2213 2214- fixed docs to remove the notion that yield-fixtures are experimental. 2215 They are here to stay :) Thanks Bruno Oliveira. 2216 2217- Support building wheels by using environment markers for the 2218 requirements. Thanks Ionel Maries Cristian. 2219 2220- fixed regression to 2.6.4 which surfaced e.g. in lost stdout capture printing 2221 when tests raised SystemExit. Thanks Holger Krekel. 2222 2223- reintroduced _pytest fixture of the pytester plugin which is used 2224 at least by pytest-xdist. 2225 22262.7.0 (2015-03-26) 2227================== 2228 2229- fix issue435: make reload() work when assert rewriting is active. 2230 Thanks Daniel Hahler. 2231 2232- fix issue616: conftest.py files and their contained fixutres are now 2233 properly considered for visibility, independently from the exact 2234 current working directory and test arguments that are used. 2235 Many thanks to Eric Siegerman and his PR235 which contains 2236 systematic tests for conftest visibility and now passes. 2237 This change also introduces the concept of a ``rootdir`` which 2238 is printed as a new pytest header and documented in the pytest 2239 customize web page. 2240 2241- change reporting of "diverted" tests, i.e. tests that are collected 2242 in one file but actually come from another (e.g. when tests in a test class 2243 come from a base class in a different file). We now show the nodeid 2244 and indicate via a postfix the other file. 2245 2246- add ability to set command line options by environment variable PYTEST_ADDOPTS. 2247 2248- added documentation on the new pytest-dev teams on bitbucket and 2249 github. See https://pytest.org/latest/contributing.html . 2250 Thanks to Anatoly for pushing and initial work on this. 2251 2252- fix issue650: new option ``--docttest-ignore-import-errors`` which 2253 will turn import errors in doctests into skips. Thanks Charles Cloud 2254 for the complete PR. 2255 2256- fix issue655: work around different ways that cause python2/3 2257 to leak sys.exc_info into fixtures/tests causing failures in 3rd party code 2258 2259- fix issue615: assertion rewriting did not correctly escape % signs 2260 when formatting boolean operations, which tripped over mixing 2261 booleans with modulo operators. Thanks to Tom Viner for the report, 2262 triaging and fix. 2263 2264- implement issue351: add ability to specify parametrize ids as a callable 2265 to generate custom test ids. Thanks Brianna Laugher for the idea and 2266 implementation. 2267 2268- introduce and document new hookwrapper mechanism useful for plugins 2269 which want to wrap the execution of certain hooks for their purposes. 2270 This supersedes the undocumented ``__multicall__`` protocol which 2271 pytest itself and some external plugins use. Note that pytest-2.8 2272 is scheduled to drop supporting the old ``__multicall__`` 2273 and only support the hookwrapper protocol. 2274 2275- majorly speed up invocation of plugin hooks 2276 2277- use hookwrapper mechanism in builtin pytest plugins. 2278 2279- add a doctest ini option for doctest flags, thanks Holger Peters. 2280 2281- add note to docs that if you want to mark a parameter and the 2282 parameter is a callable, you also need to pass in a reason to disambiguate 2283 it from the "decorator" case. Thanks Tom Viner. 2284 2285- "python_classes" and "python_functions" options now support glob-patterns 2286 for test discovery, as discussed in issue600. Thanks Ldiary Translations. 2287 2288- allow to override parametrized fixtures with non-parametrized ones and vice versa (bubenkoff). 2289 2290- fix issue463: raise specific error for 'parameterize' misspelling (pfctdayelise). 2291 2292- On failure, the ``sys.last_value``, ``sys.last_type`` and 2293 ``sys.last_traceback`` are set, so that a user can inspect the error 2294 via postmortem debugging (almarklein). 2295 22962.6.4 (2014-10-24) 2297================== 2298 2299- Improve assertion failure reporting on iterables, by using ndiff and 2300 pprint. 2301 2302- removed outdated japanese docs from source tree. 2303 2304- docs for "pytest_addhooks" hook. Thanks Bruno Oliveira. 2305 2306- updated plugin index docs. Thanks Bruno Oliveira. 2307 2308- fix issue557: with "-k" we only allow the old style "-" for negation 2309 at the beginning of strings and even that is deprecated. Use "not" instead. 2310 This should allow to pick parametrized tests where "-" appeared in the parameter. 2311 2312- fix issue604: Escape % character in the assertion message. 2313 2314- fix issue620: add explanation in the --genscript target about what 2315 the binary blob means. Thanks Dinu Gherman. 2316 2317- fix issue614: fixed pastebin support. 2318 2319 2320- fix issue620: add explanation in the --genscript target about what 2321 the binary blob means. Thanks Dinu Gherman. 2322 2323- fix issue614: fixed pastebin support. 2324 23252.6.3 (2014-09-24) 2326================== 2327 2328- fix issue575: xunit-xml was reporting collection errors as failures 2329 instead of errors, thanks Oleg Sinyavskiy. 2330 2331- fix issue582: fix setuptools example, thanks Laszlo Papp and Ronny 2332 Pfannschmidt. 2333 2334- Fix infinite recursion bug when pickling capture.EncodedFile, thanks 2335 Uwe Schmitt. 2336 2337- fix issue589: fix bad interaction with numpy and others when showing 2338 exceptions. Check for precise "maximum recursion depth exceed" exception 2339 instead of presuming any RuntimeError is that one (implemented in py 2340 dep). Thanks Charles Cloud for analysing the issue. 2341 2342- fix conftest related fixture visibility issue: when running with a 2343 CWD outside of a test package pytest would get fixture discovery wrong. 2344 Thanks to Wolfgang Schnerring for figuring out a reproducible example. 2345 2346- Introduce pytest_enter_pdb hook (needed e.g. by pytest_timeout to cancel the 2347 timeout when interactively entering pdb). Thanks Wolfgang Schnerring. 2348 2349- check xfail/skip also with non-python function test items. Thanks 2350 Floris Bruynooghe. 2351 23522.6.2 (2014-09-05) 2353================== 2354 2355- Added function pytest.freeze_includes(), which makes it easy to embed 2356 pytest into executables using tools like cx_freeze. 2357 See docs for examples and rationale. Thanks Bruno Oliveira. 2358 2359- Improve assertion rewriting cache invalidation precision. 2360 2361- fixed issue561: adapt autouse fixture example for python3. 2362 2363- fixed issue453: assertion rewriting issue with __repr__ containing 2364 "\n{", "\n}" and "\n~". 2365 2366- fix issue560: correctly display code if an "else:" or "finally:" is 2367 followed by statements on the same line. 2368 2369- Fix example in monkeypatch documentation, thanks t-8ch. 2370 2371- fix issue572: correct tmpdir doc example for python3. 2372 2373- Do not mark as universal wheel because Python 2.6 is different from 2374 other builds due to the extra argparse dependency. Fixes issue566. 2375 Thanks sontek. 2376 2377- Implement issue549: user-provided assertion messages now no longer 2378 replace the py.test introspection message but are shown in addition 2379 to them. 2380 23812.6.1 (2014-08-07) 2382================== 2383 2384- No longer show line numbers in the --verbose output, the output is now 2385 purely the nodeid. The line number is still shown in failure reports. 2386 Thanks Floris Bruynooghe. 2387 2388- fix issue437 where assertion rewriting could cause pytest-xdist slaves 2389 to collect different tests. Thanks Bruno Oliveira. 2390 2391- fix issue555: add "errors" attribute to capture-streams to satisfy 2392 some distutils and possibly other code accessing sys.stdout.errors. 2393 2394- fix issue547 capsys/capfd also work when output capturing ("-s") is disabled. 2395 2396- address issue170: allow pytest.mark.xfail(...) to specify expected exceptions via 2397 an optional "raises=EXC" argument where EXC can be a single exception 2398 or a tuple of exception classes. Thanks David Mohr for the complete 2399 PR. 2400 2401- fix integration of pytest with unittest.mock.patch decorator when 2402 it uses the "new" argument. Thanks Nicolas Delaby for test and PR. 2403 2404- fix issue with detecting conftest files if the arguments contain 2405 "::" node id specifications (copy pasted from "-v" output) 2406 2407- fix issue544 by only removing "@NUM" at the end of "::" separated parts 2408 and if the part has an ".py" extension 2409 2410- don't use py.std import helper, rather import things directly. 2411 Thanks Bruno Oliveira. 2412 24132.6 2414=== 2415 2416- Cache exceptions from fixtures according to their scope (issue 467). 2417 2418- fix issue537: Avoid importing old assertion reinterpretation code by default. 2419 2420- fix issue364: shorten and enhance tracebacks representation by default. 2421 The new "--tb=auto" option (default) will only display long tracebacks 2422 for the first and last entry. You can get the old behaviour of printing 2423 all entries as long entries with "--tb=long". Also short entries by 2424 default are now printed very similarly to "--tb=native" ones. 2425 2426- fix issue514: teach assertion reinterpretation about private class attributes 2427 2428- change -v output to include full node IDs of tests. Users can copy 2429 a node ID from a test run, including line number, and use it as a 2430 positional argument in order to run only a single test. 2431 2432- fix issue 475: fail early and comprehensible if calling 2433 pytest.raises with wrong exception type. 2434 2435- fix issue516: tell in getting-started about current dependencies. 2436 2437- cleanup setup.py a bit and specify supported versions. Thanks Jurko 2438 Gospodnetic for the PR. 2439 2440- change XPASS colour to yellow rather then red when tests are run 2441 with -v. 2442 2443- fix issue473: work around mock putting an unbound method into a class 2444 dict when double-patching. 2445 2446- fix issue498: if a fixture finalizer fails, make sure that 2447 the fixture is still invalidated. 2448 2449- fix issue453: the result of the pytest_assertrepr_compare hook now gets 2450 it's newlines escaped so that format_exception does not blow up. 2451 2452- internal new warning system: pytest will now produce warnings when 2453 it detects oddities in your test collection or execution. 2454 Warnings are ultimately sent to a new pytest_logwarning hook which is 2455 currently only implemented by the terminal plugin which displays 2456 warnings in the summary line and shows more details when -rw (report on 2457 warnings) is specified. 2458 2459- change skips into warnings for test classes with an __init__ and 2460 callables in test modules which look like a test but are not functions. 2461 2462- fix issue436: improved finding of initial conftest files from command 2463 line arguments by using the result of parse_known_args rather than 2464 the previous flaky heuristics. Thanks Marc Abramowitz for tests 2465 and initial fixing approaches in this area. 2466 2467- fix issue #479: properly handle nose/unittest(2) SkipTest exceptions 2468 during collection/loading of test modules. Thanks to Marc Schlaich 2469 for the complete PR. 2470 2471- fix issue490: include pytest_load_initial_conftests in documentation 2472 and improve docstring. 2473 2474- fix issue472: clarify that ``pytest.config.getvalue()`` cannot work 2475 if it's triggered ahead of command line parsing. 2476 2477- merge PR123: improved integration with mock.patch decorator on tests. 2478 2479- fix issue412: messing with stdout/stderr FD-level streams is now 2480 captured without crashes. 2481 2482- fix issue483: trial/py33 works now properly. Thanks Daniel Grana for PR. 2483 2484- improve example for pytest integration with "python setup.py test" 2485 which now has a generic "-a" or "--pytest-args" option where you 2486 can pass additional options as a quoted string. Thanks Trevor Bekolay. 2487 2488- simplified internal capturing mechanism and made it more robust 2489 against tests or setups changing FD1/FD2, also better integrated 2490 now with pytest.pdb() in single tests. 2491 2492- improvements to pytest's own test-suite leakage detection, courtesy of PRs 2493 from Marc Abramowitz 2494 2495- fix issue492: avoid leak in test_writeorg. Thanks Marc Abramowitz. 2496 2497- fix issue493: don't run tests in doc directory with ``python setup.py test`` 2498 (use tox -e doctesting for that) 2499 2500- fix issue486: better reporting and handling of early conftest loading failures 2501 2502- some cleanup and simplification of internal conftest handling. 2503 2504- work a bit harder to break reference cycles when catching exceptions. 2505 Thanks Jurko Gospodnetic. 2506 2507- fix issue443: fix skip examples to use proper comparison. Thanks Alex 2508 Groenholm. 2509 2510- support nose-style ``__test__`` attribute on modules, classes and 2511 functions, including unittest-style Classes. If set to False, the 2512 test will not be collected. 2513 2514- fix issue512: show "<notset>" for arguments which might not be set 2515 in monkeypatch plugin. Improves output in documentation. 2516 2517 25182.5.2 (2014-01-29) 2519================== 2520 2521- fix issue409 -- better interoperate with cx_freeze by not 2522 trying to import from collections.abc which causes problems 2523 for py27/cx_freeze. Thanks Wolfgang L. for reporting and tracking it down. 2524 2525- fixed docs and code to use "pytest" instead of "py.test" almost everywhere. 2526 Thanks Jurko Gospodnetic for the complete PR. 2527 2528- fix issue425: mention at end of "py.test -h" that --markers 2529 and --fixtures work according to specified test path (or current dir) 2530 2531- fix issue413: exceptions with unicode attributes are now printed 2532 correctly also on python2 and with pytest-xdist runs. (the fix 2533 requires py-1.4.20) 2534 2535- copy, cleanup and integrate py.io capture 2536 from pylib 1.4.20.dev2 (rev 13d9af95547e) 2537 2538- address issue416: clarify docs as to conftest.py loading semantics 2539 2540- fix issue429: comparing byte strings with non-ascii chars in assert 2541 expressions now work better. Thanks Floris Bruynooghe. 2542 2543- make capfd/capsys.capture private, its unused and shouldn't be exposed 2544 2545 25462.5.1 (2013-12-17) 2547================== 2548 2549- merge new documentation styling PR from Tobias Bieniek. 2550 2551- fix issue403: allow parametrize of multiple same-name functions within 2552 a collection node. Thanks Andreas Kloeckner and Alex Gaynor for reporting 2553 and analysis. 2554 2555- Allow parameterized fixtures to specify the ID of the parameters by 2556 adding an ids argument to pytest.fixture() and pytest.yield_fixture(). 2557 Thanks Floris Bruynooghe. 2558 2559- fix issue404 by always using the binary xml escape in the junitxml 2560 plugin. Thanks Ronny Pfannschmidt. 2561 2562- fix issue407: fix addoption docstring to point to argparse instead of 2563 optparse. Thanks Daniel D. Wright. 2564 2565 2566 25672.5.0 (2013-12-12) 2568================== 2569 2570- dropped python2.5 from automated release testing of pytest itself 2571 which means it's probably going to break soon (but still works 2572 with this release we believe). 2573 2574- simplified and fixed implementation for calling finalizers when 2575 parametrized fixtures or function arguments are involved. finalization 2576 is now performed lazily at setup time instead of in the "teardown phase". 2577 While this might sound odd at first, it helps to ensure that we are 2578 correctly handling setup/teardown even in complex code. User-level code 2579 should not be affected unless it's implementing the pytest_runtest_teardown 2580 hook and expecting certain fixture instances are torn down within (very 2581 unlikely and would have been unreliable anyway). 2582 2583- PR90: add --color=yes|no|auto option to force terminal coloring 2584 mode ("auto" is default). Thanks Marc Abramowitz. 2585 2586- fix issue319 - correctly show unicode in assertion errors. Many 2587 thanks to Floris Bruynooghe for the complete PR. Also means 2588 we depend on py>=1.4.19 now. 2589 2590- fix issue396 - correctly sort and finalize class-scoped parametrized 2591 tests independently from number of methods on the class. 2592 2593- refix issue323 in a better way -- parametrization should now never 2594 cause Runtime Recursion errors because the underlying algorithm 2595 for re-ordering tests per-scope/per-fixture is not recursive 2596 anymore (it was tail-call recursive before which could lead 2597 to problems for more than >966 non-function scoped parameters). 2598 2599- fix issue290 - there is preliminary support now for parametrizing 2600 with repeated same values (sometimes useful to test if calling 2601 a second time works as with the first time). 2602 2603- close issue240 - document precisely how pytest module importing 2604 works, discuss the two common test directory layouts, and how it 2605 interacts with PEP420-namespace packages. 2606 2607- fix issue246 fix finalizer order to be LIFO on independent fixtures 2608 depending on a parametrized higher-than-function scoped fixture. 2609 (was quite some effort so please bear with the complexity of this sentence :) 2610 Thanks Ralph Schmitt for the precise failure example. 2611 2612- fix issue244 by implementing special index for parameters to only use 2613 indices for paramentrized test ids 2614 2615- fix issue287 by running all finalizers but saving the exception 2616 from the first failing finalizer and re-raising it so teardown will 2617 still have failed. We reraise the first failing exception because 2618 it might be the cause for other finalizers to fail. 2619 2620- fix ordering when mock.patch or other standard decorator-wrappings 2621 are used with test methods. This fixues issue346 and should 2622 help with random "xdist" collection failures. Thanks to 2623 Ronny Pfannschmidt and Donald Stufft for helping to isolate it. 2624 2625- fix issue357 - special case "-k" expressions to allow for 2626 filtering with simple strings that are not valid python expressions. 2627 Examples: "-k 1.3" matches all tests parametrized with 1.3. 2628 "-k None" filters all tests that have "None" in their name 2629 and conversely "-k 'not None'". 2630 Previously these examples would raise syntax errors. 2631 2632- fix issue384 by removing the trial support code 2633 since the unittest compat enhancements allow 2634 trial to handle it on its own 2635 2636- don't hide an ImportError when importing a plugin produces one. 2637 fixes issue375. 2638 2639- fix issue275 - allow usefixtures and autouse fixtures 2640 for running doctest text files. 2641 2642- fix issue380 by making --resultlog only rely on longrepr instead 2643 of the "reprcrash" attribute which only exists sometimes. 2644 2645- address issue122: allow @pytest.fixture(params=iterator) by exploding 2646 into a list early on. 2647 2648- fix pexpect-3.0 compatibility for pytest's own tests. 2649 (fixes issue386) 2650 2651- allow nested parametrize-value markers, thanks James Lan for the PR. 2652 2653- fix unicode handling with new monkeypatch.setattr(import_path, value) 2654 API. Thanks Rob Dennis. Fixes issue371. 2655 2656- fix unicode handling with junitxml, fixes issue368. 2657 2658- In assertion rewriting mode on Python 2, fix the detection of coding 2659 cookies. See issue #330. 2660 2661- make "--runxfail" turn imperative pytest.xfail calls into no ops 2662 (it already did neutralize pytest.mark.xfail markers) 2663 2664- refine pytest / pkg_resources interactions: The AssertionRewritingHook 2665 PEP302 compliant loader now registers itself with setuptools/pkg_resources 2666 properly so that the pkg_resources.resource_stream method works properly. 2667 Fixes issue366. Thanks for the investigations and full PR to Jason R. Coombs. 2668 2669- pytestconfig fixture is now session-scoped as it is the same object during the 2670 whole test run. Fixes issue370. 2671 2672- avoid one surprising case of marker malfunction/confusion:: 2673 2674 @pytest.mark.some(lambda arg: ...) 2675 def test_function(): 2676 2677 would not work correctly because pytest assumes @pytest.mark.some 2678 gets a function to be decorated already. We now at least detect if this 2679 arg is an lambda and thus the example will work. Thanks Alex Gaynor 2680 for bringing it up. 2681 2682- xfail a test on pypy that checks wrong encoding/ascii (pypy does 2683 not error out). fixes issue385. 2684 2685- internally make varnames() deal with classes's __init__, 2686 although it's not needed by pytest itself atm. Also 2687 fix caching. Fixes issue376. 2688 2689- fix issue221 - handle importing of namespace-package with no 2690 __init__.py properly. 2691 2692- refactor internal FixtureRequest handling to avoid monkeypatching. 2693 One of the positive user-facing effects is that the "request" object 2694 can now be used in closures. 2695 2696- fixed version comparison in pytest.importskip(modname, minverstring) 2697 2698- fix issue377 by clarifying in the nose-compat docs that pytest 2699 does not duplicate the unittest-API into the "plain" namespace. 2700 2701- fix verbose reporting for @mock'd test functions 2702 27032.4.2 (2013-10-04) 2704================== 2705 2706- on Windows require colorama and a newer py lib so that py.io.TerminalWriter() 2707 now uses colorama instead of its own ctypes hacks. (fixes issue365) 2708 thanks Paul Moore for bringing it up. 2709 2710- fix "-k" matching of tests where "repr" and "attr" and other names would 2711 cause wrong matches because of an internal implementation quirk 2712 (don't ask) which is now properly implemented. fixes issue345. 2713 2714- avoid tmpdir fixture to create too long filenames especially 2715 when parametrization is used (issue354) 2716 2717- fix pytest-pep8 and pytest-flakes / pytest interactions 2718 (collection names in mark plugin was assuming an item always 2719 has a function which is not true for those plugins etc.) 2720 Thanks Andi Zeidler. 2721 2722- introduce node.get_marker/node.add_marker API for plugins 2723 like pytest-pep8 and pytest-flakes to avoid the messy 2724 details of the node.keywords pseudo-dicts. Adapted 2725 docs. 2726 2727- remove attempt to "dup" stdout at startup as it's icky. 2728 the normal capturing should catch enough possibilities 2729 of tests messing up standard FDs. 2730 2731- add pluginmanager.do_configure(config) as a link to 2732 config.do_configure() for plugin-compatibility 2733 27342.4.1 (2013-10-02) 2735================== 2736 2737- When using parser.addoption() unicode arguments to the 2738 "type" keyword should also be converted to the respective types. 2739 thanks Floris Bruynooghe, @dnozay. (fixes issue360 and issue362) 2740 2741- fix dotted filename completion when using argcomplete 2742 thanks Anthon van der Neuth. (fixes issue361) 2743 2744- fix regression when a 1-tuple ("arg",) is used for specifying 2745 parametrization (the values of the parametrization were passed 2746 nested in a tuple). Thanks Donald Stufft. 2747 2748- merge doc typo fixes, thanks Andy Dirnberger 2749 27502.4 2751=== 2752 2753known incompatibilities: 2754 2755- if calling --genscript from python2.7 or above, you only get a 2756 standalone script which works on python2.7 or above. Use Python2.6 2757 to also get a python2.5 compatible version. 2758 2759- all xunit-style teardown methods (nose-style, pytest-style, 2760 unittest-style) will not be called if the corresponding setup method failed, 2761 see issue322 below. 2762 2763- the pytest_plugin_unregister hook wasn't ever properly called 2764 and there is no known implementation of the hook - so it got removed. 2765 2766- pytest.fixture-decorated functions cannot be generators (i.e. use 2767 yield) anymore. This change might be reversed in 2.4.1 if it causes 2768 unforeseen real-life issues. However, you can always write and return 2769 an inner function/generator and change the fixture consumer to iterate 2770 over the returned generator. This change was done in lieu of the new 2771 ``pytest.yield_fixture`` decorator, see below. 2772 2773new features: 2774 2775- experimentally introduce a new ``pytest.yield_fixture`` decorator 2776 which accepts exactly the same parameters as pytest.fixture but 2777 mandates a ``yield`` statement instead of a ``return statement`` from 2778 fixture functions. This allows direct integration with "with-style" 2779 context managers in fixture functions and generally avoids registering 2780 of finalization callbacks in favour of treating the "after-yield" as 2781 teardown code. Thanks Andreas Pelme, Vladimir Keleshev, Floris 2782 Bruynooghe, Ronny Pfannschmidt and many others for discussions. 2783 2784- allow boolean expression directly with skipif/xfail 2785 if a "reason" is also specified. Rework skipping documentation 2786 to recommend "condition as booleans" because it prevents surprises 2787 when importing markers between modules. Specifying conditions 2788 as strings will remain fully supported. 2789 2790- reporting: color the last line red or green depending if 2791 failures/errors occurred or everything passed. thanks Christian 2792 Theunert. 2793 2794- make "import pdb ; pdb.set_trace()" work natively wrt capturing (no 2795 "-s" needed anymore), making ``pytest.set_trace()`` a mere shortcut. 2796 2797- fix issue181: --pdb now also works on collect errors (and 2798 on internal errors) . This was implemented by a slight internal 2799 refactoring and the introduction of a new hook 2800 ``pytest_exception_interact`` hook (see next item). 2801 2802- fix issue341: introduce new experimental hook for IDEs/terminals to 2803 intercept debugging: ``pytest_exception_interact(node, call, report)``. 2804 2805- new monkeypatch.setattr() variant to provide a shorter 2806 invocation for patching out classes/functions from modules: 2807 2808 monkeypatch.setattr("requests.get", myfunc) 2809 2810 will replace the "get" function of the "requests" module with ``myfunc``. 2811 2812- fix issue322: tearDownClass is not run if setUpClass failed. Thanks 2813 Mathieu Agopian for the initial fix. Also make all of pytest/nose 2814 finalizer mimic the same generic behaviour: if a setupX exists and 2815 fails, don't run teardownX. This internally introduces a new method 2816 "node.addfinalizer()" helper which can only be called during the setup 2817 phase of a node. 2818 2819- simplify pytest.mark.parametrize() signature: allow to pass a 2820 CSV-separated string to specify argnames. For example: 2821 ``pytest.mark.parametrize("input,expected", [(1,2), (2,3)])`` 2822 works as well as the previous: 2823 ``pytest.mark.parametrize(("input", "expected"), ...)``. 2824 2825- add support for setUpModule/tearDownModule detection, thanks Brian Okken. 2826 2827- integrate tab-completion on options through use of "argcomplete". 2828 Thanks Anthon van der Neut for the PR. 2829 2830- change option names to be hyphen-separated long options but keep the 2831 old spelling backward compatible. py.test -h will only show the 2832 hyphenated version, for example "--collect-only" but "--collectonly" 2833 will remain valid as well (for backward-compat reasons). Many thanks to 2834 Anthon van der Neut for the implementation and to Hynek Schlawack for 2835 pushing us. 2836 2837- fix issue 308 - allow to mark/xfail/skip individual parameter sets 2838 when parametrizing. Thanks Brianna Laugher. 2839 2840- call new experimental pytest_load_initial_conftests hook to allow 2841 3rd party plugins to do something before a conftest is loaded. 2842 2843Bug fixes: 2844 2845- fix issue358 - capturing options are now parsed more properly 2846 by using a new parser.parse_known_args method. 2847 2848- pytest now uses argparse instead of optparse (thanks Anthon) which 2849 means that "argparse" is added as a dependency if installing into python2.6 2850 environments or below. 2851 2852- fix issue333: fix a case of bad unittest/pytest hook interaction. 2853 2854- PR27: correctly handle nose.SkipTest during collection. Thanks 2855 Antonio Cuni, Ronny Pfannschmidt. 2856 2857- fix issue355: junitxml puts name="pytest" attribute to testsuite tag. 2858 2859- fix issue336: autouse fixture in plugins should work again. 2860 2861- fix issue279: improve object comparisons on assertion failure 2862 for standard datatypes and recognise collections.abc. Thanks to 2863 Brianna Laugher and Mathieu Agopian. 2864 2865- fix issue317: assertion rewriter support for the is_package method 2866 2867- fix issue335: document py.code.ExceptionInfo() object returned 2868 from pytest.raises(), thanks Mathieu Agopian. 2869 2870- remove implicit distribute_setup support from setup.py. 2871 2872- fix issue305: ignore any problems when writing pyc files. 2873 2874- SO-17664702: call fixture finalizers even if the fixture function 2875 partially failed (finalizers would not always be called before) 2876 2877- fix issue320 - fix class scope for fixtures when mixed with 2878 module-level functions. Thanks Anatloy Bubenkoff. 2879 2880- you can specify "-q" or "-qq" to get different levels of "quieter" 2881 reporting (thanks Katarzyna Jachim) 2882 2883- fix issue300 - Fix order of conftest loading when starting py.test 2884 in a subdirectory. 2885 2886- fix issue323 - sorting of many module-scoped arg parametrizations 2887 2888- make sessionfinish hooks execute with the same cwd-context as at 2889 session start (helps fix plugin behaviour which write output files 2890 with relative path such as pytest-cov) 2891 2892- fix issue316 - properly reference collection hooks in docs 2893 2894- fix issue 306 - cleanup of -k/-m options to only match markers/test 2895 names/keywords respectively. Thanks Wouter van Ackooy. 2896 2897- improved doctest counting for doctests in python modules -- 2898 files without any doctest items will not show up anymore 2899 and doctest examples are counted as separate test items. 2900 thanks Danilo Bellini. 2901 2902- fix issue245 by depending on the released py-1.4.14 2903 which fixes py.io.dupfile to work with files with no 2904 mode. Thanks Jason R. Coombs. 2905 2906- fix junitxml generation when test output contains control characters, 2907 addressing issue267, thanks Jaap Broekhuizen 2908 2909- fix issue338: honor --tb style for setup/teardown errors as well. Thanks Maho. 2910 2911- fix issue307 - use yaml.safe_load in example, thanks Mark Eichin. 2912 2913- better parametrize error messages, thanks Brianna Laugher 2914 2915- pytest_terminal_summary(terminalreporter) hooks can now use 2916 ".section(title)" and ".line(msg)" methods to print extra 2917 information at the end of a test run. 2918 29192.3.5 (2013-04-30) 2920================== 2921 2922- fix issue169: respect --tb=style with setup/teardown errors as well. 2923 2924- never consider a fixture function for test function collection 2925 2926- allow re-running of test items / helps to fix pytest-reruntests plugin 2927 and also help to keep less fixture/resource references alive 2928 2929- put captured stdout/stderr into junitxml output even for passing tests 2930 (thanks Adam Goucher) 2931 2932- Issue 265 - integrate nose setup/teardown with setupstate 2933 so it doesn't try to teardown if it did not setup 2934 2935- issue 271 - don't write junitxml on slave nodes 2936 2937- Issue 274 - don't try to show full doctest example 2938 when doctest does not know the example location 2939 2940- issue 280 - disable assertion rewriting on buggy CPython 2.6.0 2941 2942- inject "getfixture()" helper to retrieve fixtures from doctests, 2943 thanks Andreas Zeidler 2944 2945- issue 259 - when assertion rewriting, be consistent with the default 2946 source encoding of ASCII on Python 2 2947 2948- issue 251 - report a skip instead of ignoring classes with init 2949 2950- issue250 unicode/str mixes in parametrization names and values now works 2951 2952- issue257, assertion-triggered compilation of source ending in a 2953 comment line doesn't blow up in python2.5 (fixed through py>=1.4.13.dev6) 2954 2955- fix --genscript option to generate standalone scripts that also 2956 work with python3.3 (importer ordering) 2957 2958- issue171 - in assertion rewriting, show the repr of some 2959 global variables 2960 2961- fix option help for "-k" 2962 2963- move long description of distribution into README.rst 2964 2965- improve docstring for metafunc.parametrize() 2966 2967- fix bug where using capsys with pytest.set_trace() in a test 2968 function would break when looking at capsys.readouterr() 2969 2970- allow to specify prefixes starting with "_" when 2971 customizing python_functions test discovery. (thanks Graham Horler) 2972 2973- improve PYTEST_DEBUG tracing output by putting 2974 extra data on a new lines with additional indent 2975 2976- ensure OutcomeExceptions like skip/fail have initialized exception attributes 2977 2978- issue 260 - don't use nose special setup on plain unittest cases 2979 2980- fix issue134 - print the collect errors that prevent running specified test items 2981 2982- fix issue266 - accept unicode in MarkEvaluator expressions 2983 29842.3.4 (2012-11-20) 2985================== 2986 2987- yielded test functions will now have autouse-fixtures active but 2988 cannot accept fixtures as funcargs - it's anyway recommended to 2989 rather use the post-2.0 parametrize features instead of yield, see: 2990 http://pytest.org/latest/example/parametrize.html 2991- fix autouse-issue where autouse-fixtures would not be discovered 2992 if defined in a a/conftest.py file and tests in a/tests/test_some.py 2993- fix issue226 - LIFO ordering for fixture teardowns 2994- fix issue224 - invocations with >256 char arguments now work 2995- fix issue91 - add/discuss package/directory level setups in example 2996- allow to dynamically define markers via 2997 item.keywords[...]=assignment integrating with "-m" option 2998- make "-k" accept an expressions the same as with "-m" so that one 2999 can write: -k "name1 or name2" etc. This is a slight incompatibility 3000 if you used special syntax like "TestClass.test_method" which you now 3001 need to write as -k "TestClass and test_method" to match a certain 3002 method in a certain test class. 3003 30042.3.3 (2012-11-06) 3005================== 3006 3007- fix issue214 - parse modules that contain special objects like e. g. 3008 flask's request object which blows up on getattr access if no request 3009 is active. thanks Thomas Waldmann. 3010 3011- fix issue213 - allow to parametrize with values like numpy arrays that 3012 do not support an __eq__ operator 3013 3014- fix issue215 - split test_python.org into multiple files 3015 3016- fix issue148 - @unittest.skip on classes is now recognized and avoids 3017 calling setUpClass/tearDownClass, thanks Pavel Repin 3018 3019- fix issue209 - reintroduce python2.4 support by depending on newer 3020 pylib which re-introduced statement-finding for pre-AST interpreters 3021 3022- nose support: only call setup if it's a callable, thanks Andrew 3023 Taumoefolau 3024 3025- fix issue219 - add py2.4-3.3 classifiers to TROVE list 3026 3027- in tracebacks *,** arg values are now shown next to normal arguments 3028 (thanks Manuel Jacob) 3029 3030- fix issue217 - support mock.patch with pytest's fixtures - note that 3031 you need either mock-1.0.1 or the python3.3 builtin unittest.mock. 3032 3033- fix issue127 - improve documentation for pytest_addoption() and 3034 add a ``config.getoption(name)`` helper function for consistency. 3035 30362.3.2 (2012-10-25) 3037================== 3038 3039- fix issue208 and fix issue29 use new py version to avoid long pauses 3040 when printing tracebacks in long modules 3041 3042- fix issue205 - conftests in subdirs customizing 3043 pytest_pycollect_makemodule and pytest_pycollect_makeitem 3044 now work properly 3045 3046- fix teardown-ordering for parametrized setups 3047 3048- fix issue127 - better documentation for pytest_addoption 3049 and related objects. 3050 3051- fix unittest behaviour: TestCase.runtest only called if there are 3052 test methods defined 3053 3054- improve trial support: don't collect its empty 3055 unittest.TestCase.runTest() method 3056 3057- "python setup.py test" now works with pytest itself 3058 3059- fix/improve internal/packaging related bits: 3060 3061 - exception message check of test_nose.py now passes on python33 as well 3062 3063 - issue206 - fix test_assertrewrite.py to work when a global 3064 PYTHONDONTWRITEBYTECODE=1 is present 3065 3066 - add tox.ini to pytest distribution so that ignore-dirs and others config 3067 bits are properly distributed for maintainers who run pytest-own tests 3068 30692.3.1 (2012-10-20) 3070================== 3071 3072- fix issue202 - fix regression: using "self" from fixture functions now 3073 works as expected (it's the same "self" instance that a test method 3074 which uses the fixture sees) 3075 3076- skip pexpect using tests (test_pdb.py mostly) on freebsd* systems 3077 due to pexpect not supporting it properly (hanging) 3078 3079- link to web pages from --markers output which provides help for 3080 pytest.mark.* usage. 3081 30822.3.0 (2012-10-19) 3083================== 3084 3085- fix issue202 - better automatic names for parametrized test functions 3086- fix issue139 - introduce @pytest.fixture which allows direct scoping 3087 and parametrization of funcarg factories. 3088- fix issue198 - conftest fixtures were not found on windows32 in some 3089 circumstances with nested directory structures due to path manipulation issues 3090- fix issue193 skip test functions with were parametrized with empty 3091 parameter sets 3092- fix python3.3 compat, mostly reporting bits that previously depended 3093 on dict ordering 3094- introduce re-ordering of tests by resource and parametrization setup 3095 which takes precedence to the usual file-ordering 3096- fix issue185 monkeypatching time.time does not cause pytest to fail 3097- fix issue172 duplicate call of pytest.fixture decoratored setup_module 3098 functions 3099- fix junitxml=path construction so that if tests change the 3100 current working directory and the path is a relative path 3101 it is constructed correctly from the original current working dir. 3102- fix "python setup.py test" example to cause a proper "errno" return 3103- fix issue165 - fix broken doc links and mention stackoverflow for FAQ 3104- catch unicode-issues when writing failure representations 3105 to terminal to prevent the whole session from crashing 3106- fix xfail/skip confusion: a skip-mark or an imperative pytest.skip 3107 will now take precedence before xfail-markers because we 3108 can't determine xfail/xpass status in case of a skip. see also: 3109 http://stackoverflow.com/questions/11105828/in-py-test-when-i-explicitly-skip-a-test-that-is-marked-as-xfail-how-can-i-get 3110 3111- always report installed 3rd party plugins in the header of a test run 3112 3113- fix issue160: a failing setup of an xfail-marked tests should 3114 be reported as xfail (not xpass) 3115 3116- fix issue128: show captured output when capsys/capfd are used 3117 3118- fix issue179: properly show the dependency chain of factories 3119 3120- pluginmanager.register(...) now raises ValueError if the 3121 plugin has been already registered or the name is taken 3122 3123- fix issue159: improve http://pytest.org/latest/faq.html 3124 especially with respect to the "magic" history, also mention 3125 pytest-django, trial and unittest integration. 3126 3127- make request.keywords and node.keywords writable. All descendant 3128 collection nodes will see keyword values. Keywords are dictionaries 3129 containing markers and other info. 3130 3131- fix issue 178: xml binary escapes are now wrapped in py.xml.raw 3132 3133- fix issue 176: correctly catch the builtin AssertionError 3134 even when we replaced AssertionError with a subclass on the 3135 python level 3136 3137- factory discovery no longer fails with magic global callables 3138 that provide no sane __code__ object (mock.call for example) 3139 3140- fix issue 182: testdir.inprocess_run now considers passed plugins 3141 3142- fix issue 188: ensure sys.exc_info is clear on python2 3143 before calling into a test 3144 3145- fix issue 191: add unittest TestCase runTest method support 3146- fix issue 156: monkeypatch correctly handles class level descriptors 3147 3148- reporting refinements: 3149 3150 - pytest_report_header now receives a "startdir" so that 3151 you can use startdir.bestrelpath(yourpath) to show 3152 nice relative path 3153 3154 - allow plugins to implement both pytest_report_header and 3155 pytest_sessionstart (sessionstart is invoked first). 3156 3157 - don't show deselected reason line if there is none 3158 3159 - py.test -vv will show all of assert comparisons instead of truncating 3160 31612.2.4 (2012-05-22) 3162================== 3163 3164- fix error message for rewritten assertions involving the % operator 3165- fix issue 126: correctly match all invalid xml characters for junitxml 3166 binary escape 3167- fix issue with unittest: now @unittest.expectedFailure markers should 3168 be processed correctly (you can also use @pytest.mark markers) 3169- document integration with the extended distribute/setuptools test commands 3170- fix issue 140: properly get the real functions 3171 of bound classmethods for setup/teardown_class 3172- fix issue #141: switch from the deceased paste.pocoo.org to bpaste.net 3173- fix issue #143: call unconfigure/sessionfinish always when 3174 configure/sessionstart where called 3175- fix issue #144: better mangle test ids to junitxml classnames 3176- upgrade distribute_setup.py to 0.6.27 3177 31782.2.3 (2012-02-05) 3179================== 3180 3181- fix uploaded package to only include necessary files 3182 31832.2.2 (2012-02-05) 3184================== 3185 3186- fix issue101: wrong args to unittest.TestCase test function now 3187 produce better output 3188- fix issue102: report more useful errors and hints for when a 3189 test directory was renamed and some pyc/__pycache__ remain 3190- fix issue106: allow parametrize to be applied multiple times 3191 e.g. from module, class and at function level. 3192- fix issue107: actually perform session scope finalization 3193- don't check in parametrize if indirect parameters are funcarg names 3194- add chdir method to monkeypatch funcarg 3195- fix crash resulting from calling monkeypatch undo a second time 3196- fix issue115: make --collectonly robust against early failure 3197 (missing files/directories) 3198- "-qq --collectonly" now shows only files and the number of tests in them 3199- "-q --collectonly" now shows test ids 3200- allow adding of attributes to test reports such that it also works 3201 with distributed testing (no upgrade of pytest-xdist needed) 3202 32032.2.1 (2011-12-16) 3204================== 3205 3206- fix issue99 (in pytest and py) internallerrors with resultlog now 3207 produce better output - fixed by normalizing pytest_internalerror 3208 input arguments. 3209- fix issue97 / traceback issues (in pytest and py) improve traceback output 3210 in conjunction with jinja2 and cython which hack tracebacks 3211- fix issue93 (in pytest and pytest-xdist) avoid "delayed teardowns": 3212 the final test in a test node will now run its teardown directly 3213 instead of waiting for the end of the session. Thanks Dave Hunt for 3214 the good reporting and feedback. The pytest_runtest_protocol as well 3215 as the pytest_runtest_teardown hooks now have "nextitem" available 3216 which will be None indicating the end of the test run. 3217- fix collection crash due to unknown-source collected items, thanks 3218 to Ralf Schmitt (fixed by depending on a more recent pylib) 3219 32202.2.0 (2011-11-18) 3221================== 3222 3223- fix issue90: introduce eager tearing down of test items so that 3224 teardown function are called earlier. 3225- add an all-powerful metafunc.parametrize function which allows to 3226 parametrize test function arguments in multiple steps and therefore 3227 from independent plugins and places. 3228- add a @pytest.mark.parametrize helper which allows to easily 3229 call a test function with different argument values 3230- Add examples to the "parametrize" example page, including a quick port 3231 of Test scenarios and the new parametrize function and decorator. 3232- introduce registration for "pytest.mark.*" helpers via ini-files 3233 or through plugin hooks. Also introduce a "--strict" option which 3234 will treat unregistered markers as errors 3235 allowing to avoid typos and maintain a well described set of markers 3236 for your test suite. See exaples at http://pytest.org/latest/mark.html 3237 and its links. 3238- issue50: introduce "-m marker" option to select tests based on markers 3239 (this is a stricter and more predictable version of '-k' in that "-m" 3240 only matches complete markers and has more obvious rules for and/or 3241 semantics. 3242- new feature to help optimizing the speed of your tests: 3243 --durations=N option for displaying N slowest test calls 3244 and setup/teardown methods. 3245- fix issue87: --pastebin now works with python3 3246- fix issue89: --pdb with unexpected exceptions in doctest work more sensibly 3247- fix and cleanup pytest's own test suite to not leak FDs 3248- fix issue83: link to generated funcarg list 3249- fix issue74: pyarg module names are now checked against imp.find_module false positives 3250- fix compatibility with twisted/trial-11.1.0 use cases 3251- simplify Node.listchain 3252- simplify junitxml output code by relying on py.xml 3253- add support for skip properties on unittest classes and functions 3254 32552.1.3 (2011-10-18) 3256================== 3257 3258- fix issue79: assertion rewriting failed on some comparisons in boolops 3259- correctly handle zero length arguments (a la pytest '') 3260- fix issue67 / junitxml now contains correct test durations, thanks ronny 3261- fix issue75 / skipping test failure on jython 3262- fix issue77 / Allow assertrepr_compare hook to apply to a subset of tests 3263 32642.1.2 (2011-09-24) 3265================== 3266 3267- fix assertion rewriting on files with windows newlines on some Python versions 3268- refine test discovery by package/module name (--pyargs), thanks Florian Mayer 3269- fix issue69 / assertion rewriting fixed on some boolean operations 3270- fix issue68 / packages now work with assertion rewriting 3271- fix issue66: use different assertion rewriting caches when the -O option is passed 3272- don't try assertion rewriting on Jython, use reinterp 3273 32742.1.1 3275===== 3276 3277- fix issue64 / pytest.set_trace now works within pytest_generate_tests hooks 3278- fix issue60 / fix error conditions involving the creation of __pycache__ 3279- fix issue63 / assertion rewriting on inserts involving strings containing '%' 3280- fix assertion rewriting on calls with a ** arg 3281- don't cache rewritten modules if bytecode generation is disabled 3282- fix assertion rewriting in read-only directories 3283- fix issue59: provide system-out/err tags for junitxml output 3284- fix issue61: assertion rewriting on boolean operations with 3 or more operands 3285- you can now build a man page with "cd doc ; make man" 3286 32872.1.0 (2011-07-09) 3288================== 3289 3290- fix issue53 call nosestyle setup functions with correct ordering 3291- fix issue58 and issue59: new assertion code fixes 3292- merge Benjamin's assertionrewrite branch: now assertions 3293 for test modules on python 2.6 and above are done by rewriting 3294 the AST and saving the pyc file before the test module is imported. 3295 see doc/assert.txt for more info. 3296- fix issue43: improve doctests with better traceback reporting on 3297 unexpected exceptions 3298- fix issue47: timing output in junitxml for test cases is now correct 3299- fix issue48: typo in MarkInfo repr leading to exception 3300- fix issue49: avoid confusing error when initizaliation partially fails 3301- fix issue44: env/username expansion for junitxml file path 3302- show releaselevel information in test runs for pypy 3303- reworked doc pages for better navigation and PDF generation 3304- report KeyboardInterrupt even if interrupted during session startup 3305- fix issue 35 - provide PDF doc version and download link from index page 3306 33072.0.3 (2011-05-11) 3308================== 3309 3310- fix issue38: nicer tracebacks on calls to hooks, particularly early 3311 configure/sessionstart ones 3312 3313- fix missing skip reason/meta information in junitxml files, reported 3314 via http://lists.idyll.org/pipermail/testing-in-python/2011-March/003928.html 3315 3316- fix issue34: avoid collection failure with "test" prefixed classes 3317 deriving from object. 3318 3319- don't require zlib (and other libs) for genscript plugin without 3320 --genscript actually being used. 3321 3322- speed up skips (by not doing a full traceback representation 3323 internally) 3324 3325- fix issue37: avoid invalid characters in junitxml's output 3326 33272.0.2 (2011-03-09) 3328================== 3329 3330- tackle issue32 - speed up test runs of very quick test functions 3331 by reducing the relative overhead 3332 3333- fix issue30 - extended xfail/skipif handling and improved reporting. 3334 If you have a syntax error in your skip/xfail 3335 expressions you now get nice error reports. 3336 3337 Also you can now access module globals from xfail/skipif 3338 expressions so that this for example works now:: 3339 3340 import pytest 3341 import mymodule 3342 @pytest.mark.skipif("mymodule.__version__[0] == "1") 3343 def test_function(): 3344 pass 3345 3346 This will not run the test function if the module's version string 3347 does not start with a "1". Note that specifying a string instead 3348 of a boolean expressions allows py.test to report meaningful information 3349 when summarizing a test run as to what conditions lead to skipping 3350 (or xfail-ing) tests. 3351 3352- fix issue28 - setup_method and pytest_generate_tests work together 3353 The setup_method fixture method now gets called also for 3354 test function invocations generated from the pytest_generate_tests 3355 hook. 3356 3357- fix issue27 - collectonly and keyword-selection (-k) now work together 3358 Also, if you do "py.test --collectonly -q" you now get a flat list 3359 of test ids that you can use to paste to the py.test commandline 3360 in order to execute a particular test. 3361 3362- fix issue25 avoid reported problems with --pdb and python3.2/encodings output 3363 3364- fix issue23 - tmpdir argument now works on Python3.2 and WindowsXP 3365 Starting with Python3.2 os.symlink may be supported. By requiring 3366 a newer py lib version the py.path.local() implementation acknowledges 3367 this. 3368 3369- fixed typos in the docs (thanks Victor Garcia, Brianna Laugher) and particular 3370 thanks to Laura Creighton who also reviewed parts of the documentation. 3371 3372- fix slightly wrong output of verbose progress reporting for classes 3373 (thanks Amaury) 3374 3375- more precise (avoiding of) deprecation warnings for node.Class|Function accesses 3376 3377- avoid std unittest assertion helper code in tracebacks (thanks Ronny) 3378 33792.0.1 (2011-02-07) 3380================== 3381 3382- refine and unify initial capturing so that it works nicely 3383 even if the logging module is used on an early-loaded conftest.py 3384 file or plugin. 3385- allow to omit "()" in test ids to allow for uniform test ids 3386 as produced by Alfredo's nice pytest.vim plugin. 3387- fix issue12 - show plugin versions with "--version" and 3388 "--traceconfig" and also document how to add extra information 3389 to reporting test header 3390- fix issue17 (import-* reporting issue on python3) by 3391 requiring py>1.4.0 (1.4.1 is going to include it) 3392- fix issue10 (numpy arrays truth checking) by refining 3393 assertion interpretation in py lib 3394- fix issue15: make nose compatibility tests compatible 3395 with python3 (now that nose-1.0 supports python3) 3396- remove somewhat surprising "same-conftest" detection because 3397 it ignores conftest.py when they appear in several subdirs. 3398- improve assertions ("not in"), thanks Floris Bruynooghe 3399- improve behaviour/warnings when running on top of "python -OO" 3400 (assertions and docstrings are turned off, leading to potential 3401 false positives) 3402- introduce a pytest_cmdline_processargs(args) hook 3403 to allow dynamic computation of command line arguments. 3404 This fixes a regression because py.test prior to 2.0 3405 allowed to set command line options from conftest.py 3406 files which so far pytest-2.0 only allowed from ini-files now. 3407- fix issue7: assert failures in doctest modules. 3408 unexpected failures in doctests will not generally 3409 show nicer, i.e. within the doctest failing context. 3410- fix issue9: setup/teardown functions for an xfail-marked 3411 test will report as xfail if they fail but report as normally 3412 passing (not xpassing) if they succeed. This only is true 3413 for "direct" setup/teardown invocations because teardown_class/ 3414 teardown_module cannot closely relate to a single test. 3415- fix issue14: no logging errors at process exit 3416- refinements to "collecting" output on non-ttys 3417- refine internal plugin registration and --traceconfig output 3418- introduce a mechanism to prevent/unregister plugins from the 3419 command line, see http://pytest.org/plugins.html#cmdunregister 3420- activate resultlog plugin by default 3421- fix regression wrt yielded tests which due to the 3422 collection-before-running semantics were not 3423 setup as with pytest 1.3.4. Note, however, that 3424 the recommended and much cleaner way to do test 3425 parametraization remains the "pytest_generate_tests" 3426 mechanism, see the docs. 3427 34282.0.0 (2010-11-25) 3429================== 3430 3431- pytest-2.0 is now its own package and depends on pylib-2.0 3432- new ability: python -m pytest / python -m pytest.main ability 3433- new python invocation: pytest.main(args, plugins) to load 3434 some custom plugins early. 3435- try harder to run unittest test suites in a more compatible manner 3436 by deferring setup/teardown semantics to the unittest package. 3437 also work harder to run twisted/trial and Django tests which 3438 should now basically work by default. 3439- introduce a new way to set config options via ini-style files, 3440 by default setup.cfg and tox.ini files are searched. The old 3441 ways (certain environment variables, dynamic conftest.py reading 3442 is removed). 3443- add a new "-q" option which decreases verbosity and prints a more 3444 nose/unittest-style "dot" output. 3445- fix issue135 - marks now work with unittest test cases as well 3446- fix issue126 - introduce py.test.set_trace() to trace execution via 3447 PDB during the running of tests even if capturing is ongoing. 3448- fix issue123 - new "python -m py.test" invocation for py.test 3449 (requires Python 2.5 or above) 3450- fix issue124 - make reporting more resilient against tests opening 3451 files on filedescriptor 1 (stdout). 3452- fix issue109 - sibling conftest.py files will not be loaded. 3453 (and Directory collectors cannot be customized anymore from a Directory's 3454 conftest.py - this needs to happen at least one level up). 3455- introduce (customizable) assertion failure representations and enhance 3456 output on assertion failures for comparisons and other cases (Floris Bruynooghe) 3457- nose-plugin: pass through type-signature failures in setup/teardown 3458 functions instead of not calling them (Ed Singleton) 3459- remove py.test.collect.Directory (follows from a major refactoring 3460 and simplification of the collection process) 3461- majorly reduce py.test core code, shift function/python testing to own plugin 3462- fix issue88 (finding custom test nodes from command line arg) 3463- refine 'tmpdir' creation, will now create basenames better associated 3464 with test names (thanks Ronny) 3465- "xpass" (unexpected pass) tests don't cause exitcode!=0 3466- fix issue131 / issue60 - importing doctests in __init__ files used as namespace packages 3467- fix issue93 stdout/stderr is captured while importing conftest.py 3468- fix bug: unittest collected functions now also can have "pytestmark" 3469 applied at class/module level 3470- add ability to use "class" level for cached_setup helper 3471- fix strangeness: mark.* objects are now immutable, create new instances 3472 34731.3.4 (2010-09-14) 3474================== 3475 3476- fix issue111: improve install documentation for windows 3477- fix issue119: fix custom collectability of __init__.py as a module 3478- fix issue116: --doctestmodules work with __init__.py files as well 3479- fix issue115: unify internal exception passthrough/catching/GeneratorExit 3480- fix issue118: new --tb=native for presenting cpython-standard exceptions 3481 34821.3.3 (2010-07-30) 3483================== 3484 3485- fix issue113: assertion representation problem with triple-quoted strings 3486 (and possibly other cases) 3487- make conftest loading detect that a conftest file with the same 3488 content was already loaded, avoids surprises in nested directory structures 3489 which can be produced e.g. by Hudson. It probably removes the need to use 3490 --confcutdir in most cases. 3491- fix terminal coloring for win32 3492 (thanks Michael Foord for reporting) 3493- fix weirdness: make terminal width detection work on stdout instead of stdin 3494 (thanks Armin Ronacher for reporting) 3495- remove trailing whitespace in all py/text distribution files 3496 34971.3.2 (2010-07-08) 3498================== 3499 3500**New features** 3501 3502- fix issue103: introduce py.test.raises as context manager, examples:: 3503 3504 with py.test.raises(ZeroDivisionError): 3505 x = 0 3506 1 / x 3507 3508 with py.test.raises(RuntimeError) as excinfo: 3509 call_something() 3510 3511 # you may do extra checks on excinfo.value|type|traceback here 3512 3513 (thanks Ronny Pfannschmidt) 3514 3515- Funcarg factories can now dynamically apply a marker to a 3516 test invocation. This is for example useful if a factory 3517 provides parameters to a test which are expected-to-fail:: 3518 3519 def pytest_funcarg__arg(request): 3520 request.applymarker(py.test.mark.xfail(reason="flaky config")) 3521 ... 3522 3523 def test_function(arg): 3524 ... 3525 3526- improved error reporting on collection and import errors. This makes 3527 use of a more general mechanism, namely that for custom test item/collect 3528 nodes ``node.repr_failure(excinfo)`` is now uniformly called so that you can 3529 override it to return a string error representation of your choice 3530 which is going to be reported as a (red) string. 3531 3532- introduce '--junitprefix=STR' option to prepend a prefix 3533 to all reports in the junitxml file. 3534 3535**Bug fixes** 3536 3537- make tests and the ``pytest_recwarn`` plugin in particular fully compatible 3538 to Python2.7 (if you use the ``recwarn`` funcarg warnings will be enabled so that 3539 you can properly check for their existence in a cross-python manner). 3540- refine --pdb: ignore xfailed tests, unify its TB-reporting and 3541 don't display failures again at the end. 3542- fix assertion interpretation with the ** operator (thanks Benjamin Peterson) 3543- fix issue105 assignment on the same line as a failing assertion (thanks Benjamin Peterson) 3544- fix issue104 proper escaping for test names in junitxml plugin (thanks anonymous) 3545- fix issue57 -f|--looponfail to work with xpassing tests (thanks Ronny) 3546- fix issue92 collectonly reporter and --pastebin (thanks Benjamin Peterson) 3547- fix py.code.compile(source) to generate unique filenames 3548- fix assertion re-interp problems on PyPy, by defering code 3549 compilation to the (overridable) Frame.eval class. (thanks Amaury Forgeot) 3550- fix py.path.local.pyimport() to work with directories 3551- streamline py.path.local.mkdtemp implementation and usage 3552- don't print empty lines when showing junitxml-filename 3553- add optional boolean ignore_errors parameter to py.path.local.remove 3554- fix terminal writing on win32/python2.4 3555- py.process.cmdexec() now tries harder to return properly encoded unicode objects 3556 on all python versions 3557- install plain py.test/py.which scripts also for Jython, this helps to 3558 get canonical script paths in virtualenv situations 3559- make path.bestrelpath(path) return ".", note that when calling 3560 X.bestrelpath the assumption is that X is a directory. 3561- make initial conftest discovery ignore "--" prefixed arguments 3562- fix resultlog plugin when used in an multicpu/multihost xdist situation 3563 (thanks Jakub Gustak) 3564- perform distributed testing related reporting in the xdist-plugin 3565 rather than having dist-related code in the generic py.test 3566 distribution 3567- fix homedir detection on Windows 3568- ship distribute_setup.py version 0.6.13 3569 35701.3.1 (2010-05-25) 3571================== 3572 3573**New features** 3574 3575- issue91: introduce new py.test.xfail(reason) helper 3576 to imperatively mark a test as expected to fail. Can 3577 be used from within setup and test functions. This is 3578 useful especially for parametrized tests when certain 3579 configurations are expected-to-fail. In this case the 3580 declarative approach with the @py.test.mark.xfail cannot 3581 be used as it would mark all configurations as xfail. 3582 3583- issue102: introduce new --maxfail=NUM option to stop 3584 test runs after NUM failures. This is a generalization 3585 of the '-x' or '--exitfirst' option which is now equivalent 3586 to '--maxfail=1'. Both '-x' and '--maxfail' will 3587 now also print a line near the end indicating the Interruption. 3588 3589- issue89: allow py.test.mark decorators to be used on classes 3590 (class decorators were introduced with python2.6) and 3591 also allow to have multiple markers applied at class/module level 3592 by specifying a list. 3593 3594- improve and refine letter reporting in the progress bar: 3595 . pass 3596 f failed test 3597 s skipped tests (reminder: use for dependency/platform mismatch only) 3598 x xfailed test (test that was expected to fail) 3599 X xpassed test (test that was expected to fail but passed) 3600 3601 You can use any combination of 'fsxX' with the '-r' extended 3602 reporting option. The xfail/xpass results will show up as 3603 skipped tests in the junitxml output - which also fixes 3604 issue99. 3605 3606- make py.test.cmdline.main() return the exitstatus instead of raising 3607 SystemExit and also allow it to be called multiple times. This of 3608 course requires that your application and tests are properly teared 3609 down and don't have global state. 3610 3611**Bug Fixes** 3612 3613- improved traceback presentation: 3614 - improved and unified reporting for "--tb=short" option 3615 - Errors during test module imports are much shorter, (using --tb=short style) 3616 - raises shows shorter more relevant tracebacks 3617 - --fulltrace now more systematically makes traces longer / inhibits cutting 3618 3619- improve support for raises and other dynamically compiled code by 3620 manipulating python's linecache.cache instead of the previous 3621 rather hacky way of creating custom code objects. This makes 3622 it seemlessly work on Jython and PyPy where it previously didn't. 3623 3624- fix issue96: make capturing more resilient against Control-C 3625 interruptions (involved somewhat substantial refactoring 3626 to the underlying capturing functionality to avoid race 3627 conditions). 3628 3629- fix chaining of conditional skipif/xfail decorators - so it works now 3630 as expected to use multiple @py.test.mark.skipif(condition) decorators, 3631 including specific reporting which of the conditions lead to skipping. 3632 3633- fix issue95: late-import zlib so that it's not required 3634 for general py.test startup. 3635 3636- fix issue94: make reporting more robust against bogus source code 3637 (and internally be more careful when presenting unexpected byte sequences) 3638 3639 36401.3.0 (2010-05-05) 3641================== 3642 3643- deprecate --report option in favour of a new shorter and easier to 3644 remember -r option: it takes a string argument consisting of any 3645 combination of 'xfsX' characters. They relate to the single chars 3646 you see during the dotted progress printing and will print an extra line 3647 per test at the end of the test run. This extra line indicates the exact 3648 position or test ID that you directly paste to the py.test cmdline in order 3649 to re-run a particular test. 3650 3651- allow external plugins to register new hooks via the new 3652 pytest_addhooks(pluginmanager) hook. The new release of 3653 the pytest-xdist plugin for distributed and looponfailing 3654 testing requires this feature. 3655 3656- add a new pytest_ignore_collect(path, config) hook to allow projects and 3657 plugins to define exclusion behaviour for their directory structure - 3658 for example you may define in a conftest.py this method:: 3659 3660 def pytest_ignore_collect(path): 3661 return path.check(link=1) 3662 3663 to prevent even a collection try of any tests in symlinked dirs. 3664 3665- new pytest_pycollect_makemodule(path, parent) hook for 3666 allowing customization of the Module collection object for a 3667 matching test module. 3668 3669- extend and refine xfail mechanism: 3670 ``@py.test.mark.xfail(run=False)`` do not run the decorated test 3671 ``@py.test.mark.xfail(reason="...")`` prints the reason string in xfail summaries 3672 specifying ``--runxfail`` on command line virtually ignores xfail markers 3673 3674- expose (previously internal) commonly useful methods: 3675 py.io.get_terminal_with() -> return terminal width 3676 py.io.ansi_print(...) -> print colored/bold text on linux/win32 3677 py.io.saferepr(obj) -> return limited representation string 3678 3679- expose test outcome related exceptions as py.test.skip.Exception, 3680 py.test.raises.Exception etc., useful mostly for plugins 3681 doing special outcome interpretation/tweaking 3682 3683- (issue85) fix junitxml plugin to handle tests with non-ascii output 3684 3685- fix/refine python3 compatibility (thanks Benjamin Peterson) 3686 3687- fixes for making the jython/win32 combination work, note however: 3688 jython2.5.1/win32 does not provide a command line launcher, see 3689 http://bugs.jython.org/issue1491 . See pylib install documentation 3690 for how to work around. 3691 3692- fixes for handling of unicode exception values and unprintable objects 3693 3694- (issue87) fix unboundlocal error in assertionold code 3695 3696- (issue86) improve documentation for looponfailing 3697 3698- refine IO capturing: stdin-redirect pseudo-file now has a NOP close() method 3699 3700- ship distribute_setup.py version 0.6.10 3701 3702- added links to the new capturelog and coverage plugins 3703 3704 37051.2.0 (2010-01-18) 3706================== 3707 3708- refined usage and options for "py.cleanup":: 3709 3710 py.cleanup # remove "*.pyc" and "*$py.class" (jython) files 3711 py.cleanup -e .swp -e .cache # also remove files with these extensions 3712 py.cleanup -s # remove "build" and "dist" directory next to setup.py files 3713 py.cleanup -d # also remove empty directories 3714 py.cleanup -a # synonym for "-s -d -e 'pip-log.txt'" 3715 py.cleanup -n # dry run, only show what would be removed 3716 3717- add a new option "py.test --funcargs" which shows available funcargs 3718 and their help strings (docstrings on their respective factory function) 3719 for a given test path 3720 3721- display a short and concise traceback if a funcarg lookup fails 3722 3723- early-load "conftest.py" files in non-dot first-level sub directories. 3724 allows to conveniently keep and access test-related options in a ``test`` 3725 subdir and still add command line options. 3726 3727- fix issue67: new super-short traceback-printing option: "--tb=line" will print a single line for each failing (python) test indicating its filename, lineno and the failure value 3728 3729- fix issue78: always call python-level teardown functions even if the 3730 according setup failed. This includes refinements for calling setup_module/class functions 3731 which will now only be called once instead of the previous behaviour where they'd be called 3732 multiple times if they raise an exception (including a Skipped exception). Any exception 3733 will be re-corded and associated with all tests in the according module/class scope. 3734 3735- fix issue63: assume <40 columns to be a bogus terminal width, default to 80 3736 3737- fix pdb debugging to be in the correct frame on raises-related errors 3738 3739- update apipkg.py to fix an issue where recursive imports might 3740 unnecessarily break importing 3741 3742- fix plugin links 3743 37441.1.1 (2009-11-24) 3745================== 3746 3747- moved dist/looponfailing from py.test core into a new 3748 separately released pytest-xdist plugin. 3749 3750- new junitxml plugin: --junitxml=path will generate a junit style xml file 3751 which is processable e.g. by the Hudson CI system. 3752 3753- new option: --genscript=path will generate a standalone py.test script 3754 which will not need any libraries installed. thanks to Ralf Schmitt. 3755 3756- new option: --ignore will prevent specified path from collection. 3757 Can be specified multiple times. 3758 3759- new option: --confcutdir=dir will make py.test only consider conftest 3760 files that are relative to the specified dir. 3761 3762- new funcarg: "pytestconfig" is the pytest config object for access 3763 to command line args and can now be easily used in a test. 3764 3765- install ``py.test`` and ``py.which`` with a ``-$VERSION`` suffix to 3766 disambiguate between Python3, python2.X, Jython and PyPy installed versions. 3767 3768- new "pytestconfig" funcarg allows access to test config object 3769 3770- new "pytest_report_header" hook can return additional lines 3771 to be displayed at the header of a test run. 3772 3773- (experimental) allow "py.test path::name1::name2::..." for pointing 3774 to a test within a test collection directly. This might eventually 3775 evolve as a full substitute to "-k" specifications. 3776 3777- streamlined plugin loading: order is now as documented in 3778 customize.html: setuptools, ENV, commandline, conftest. 3779 also setuptools entry point names are turned to canonical namees ("pytest_*") 3780 3781- automatically skip tests that need 'capfd' but have no os.dup 3782 3783- allow pytest_generate_tests to be defined in classes as well 3784 3785- deprecate usage of 'disabled' attribute in favour of pytestmark 3786- deprecate definition of Directory, Module, Class and Function nodes 3787 in conftest.py files. Use pytest collect hooks instead. 3788 3789- collection/item node specific runtest/collect hooks are only called exactly 3790 on matching conftest.py files, i.e. ones which are exactly below 3791 the filesystem path of an item 3792 3793- change: the first pytest_collect_directory hook to return something 3794 will now prevent further hooks to be called. 3795 3796- change: figleaf plugin now requires --figleaf to run. Also 3797 change its long command line options to be a bit shorter (see py.test -h). 3798 3799- change: pytest doctest plugin is now enabled by default and has a 3800 new option --doctest-glob to set a pattern for file matches. 3801 3802- change: remove internal py._* helper vars, only keep py._pydir 3803 3804- robustify capturing to survive if custom pytest_runtest_setup 3805 code failed and prevented the capturing setup code from running. 3806 3807- make py.test.* helpers provided by default plugins visible early - 3808 works transparently both for pydoc and for interactive sessions 3809 which will regularly see e.g. py.test.mark and py.test.importorskip. 3810 3811- simplify internal plugin manager machinery 3812- simplify internal collection tree by introducing a RootCollector node 3813 3814- fix assert reinterpreation that sees a call containing "keyword=..." 3815 3816- fix issue66: invoke pytest_sessionstart and pytest_sessionfinish 3817 hooks on slaves during dist-testing, report module/session teardown 3818 hooks correctly. 3819 3820- fix issue65: properly handle dist-testing if no 3821 execnet/py lib installed remotely. 3822 3823- skip some install-tests if no execnet is available 3824 3825- fix docs, fix internal bin/ script generation 3826 3827 38281.1.0 (2009-11-05) 3829================== 3830 3831- introduce automatic plugin registration via 'pytest11' 3832 entrypoints via setuptools' pkg_resources.iter_entry_points 3833 3834- fix py.test dist-testing to work with execnet >= 1.0.0b4 3835 3836- re-introduce py.test.cmdline.main() for better backward compatibility 3837 3838- svn paths: fix a bug with path.check(versioned=True) for svn paths, 3839 allow '%' in svn paths, make svnwc.update() default to interactive mode 3840 like in 1.0.x and add svnwc.update(interactive=False) to inhibit interaction. 3841 3842- refine distributed tarball to contain test and no pyc files 3843 3844- try harder to have deprecation warnings for py.compat.* accesses 3845 report a correct location 3846 38471.0.3 3848===== 3849 3850* adjust and improve docs 3851 3852* remove py.rest tool and internal namespace - it was 3853 never really advertised and can still be used with 3854 the old release if needed. If there is interest 3855 it could be revived into its own tool i guess. 3856 3857* fix issue48 and issue59: raise an Error if the module 3858 from an imported test file does not seem to come from 3859 the filepath - avoids "same-name" confusion that has 3860 been reported repeatedly 3861 3862* merged Ronny's nose-compatibility hacks: now 3863 nose-style setup_module() and setup() functions are 3864 supported 3865 3866* introduce generalized py.test.mark function marking 3867 3868* reshuffle / refine command line grouping 3869 3870* deprecate parser.addgroup in favour of getgroup which creates option group 3871 3872* add --report command line option that allows to control showing of skipped/xfailed sections 3873 3874* generalized skipping: a new way to mark python functions with skipif or xfail 3875 at function, class and modules level based on platform or sys-module attributes. 3876 3877* extend py.test.mark decorator to allow for positional args 3878 3879* introduce and test "py.cleanup -d" to remove empty directories 3880 3881* fix issue #59 - robustify unittest test collection 3882 3883* make bpython/help interaction work by adding an __all__ attribute 3884 to ApiModule, cleanup initpkg 3885 3886* use MIT license for pylib, add some contributors 3887 3888* remove py.execnet code and substitute all usages with 'execnet' proper 3889 3890* fix issue50 - cached_setup now caches more to expectations 3891 for test functions with multiple arguments. 3892 3893* merge Jarko's fixes, issue #45 and #46 3894 3895* add the ability to specify a path for py.lookup to search in 3896 3897* fix a funcarg cached_setup bug probably only occurring 3898 in distributed testing and "module" scope with teardown. 3899 3900* many fixes and changes for making the code base python3 compatible, 3901 many thanks to Benjamin Peterson for helping with this. 3902 3903* consolidate builtins implementation to be compatible with >=2.3, 3904 add helpers to ease keeping 2 and 3k compatible code 3905 3906* deprecate py.compat.doctest|subprocess|textwrap|optparse 3907 3908* deprecate py.magic.autopath, remove py/magic directory 3909 3910* move pytest assertion handling to py/code and a pytest_assertion 3911 plugin, add "--no-assert" option, deprecate py.magic namespaces 3912 in favour of (less) py.code ones. 3913 3914* consolidate and cleanup py/code classes and files 3915 3916* cleanup py/misc, move tests to bin-for-dist 3917 3918* introduce delattr/delitem/delenv methods to py.test's monkeypatch funcarg 3919 3920* consolidate py.log implementation, remove old approach. 3921 3922* introduce py.io.TextIO and py.io.BytesIO for distinguishing between 3923 text/unicode and byte-streams (uses underlying standard lib io.* 3924 if available) 3925 3926* make py.unittest_convert helper script available which converts "unittest.py" 3927 style files into the simpler assert/direct-test-classes py.test/nosetests 3928 style. The script was written by Laura Creighton. 3929 3930* simplified internal localpath implementation 3931 39321.0.2 (2009-08-27) 3933================== 3934 3935* fixing packaging issues, triggered by fedora redhat packaging, 3936 also added doc, examples and contrib dirs to the tarball. 3937 3938* added a documentation link to the new django plugin. 3939 39401.0.1 (2009-08-19) 3941================== 3942 3943* added a 'pytest_nose' plugin which handles nose.SkipTest, 3944 nose-style function/method/generator setup/teardown and 3945 tries to report functions correctly. 3946 3947* capturing of unicode writes or encoded strings to sys.stdout/err 3948 work better, also terminalwriting was adapted and somewhat 3949 unified between windows and linux. 3950 3951* improved documentation layout and content a lot 3952 3953* added a "--help-config" option to show conftest.py / ENV-var names for 3954 all longopt cmdline options, and some special conftest.py variables. 3955 renamed 'conf_capture' conftest setting to 'option_capture' accordingly. 3956 3957* fix issue #27: better reporting on non-collectable items given on commandline 3958 (e.g. pyc files) 3959 3960* fix issue #33: added --version flag (thanks Benjamin Peterson) 3961 3962* fix issue #32: adding support for "incomplete" paths to wcpath.status() 3963 3964* "Test" prefixed classes are *not* collected by default anymore if they 3965 have an __init__ method 3966 3967* monkeypatch setenv() now accepts a "prepend" parameter 3968 3969* improved reporting of collection error tracebacks 3970 3971* simplified multicall mechanism and plugin architecture, 3972 renamed some internal methods and argnames 3973 39741.0.0 (2009-08-04) 3975================== 3976 3977* more terse reporting try to show filesystem path relatively to current dir 3978* improve xfail output a bit 3979 39801.0.0b9 (2009-07-31) 3981==================== 3982 3983* cleanly handle and report final teardown of test setup 3984 3985* fix svn-1.6 compat issue with py.path.svnwc().versioned() 3986 (thanks Wouter Vanden Hove) 3987 3988* setup/teardown or collection problems now show as ERRORs 3989 or with big "E"'s in the progress lines. they are reported 3990 and counted separately. 3991 3992* dist-testing: properly handle test items that get locally 3993 collected but cannot be collected on the remote side - often 3994 due to platform/dependency reasons 3995 3996* simplified py.test.mark API - see keyword plugin documentation 3997 3998* integrate better with logging: capturing now by default captures 3999 test functions and their immediate setup/teardown in a single stream 4000 4001* capsys and capfd funcargs now have a readouterr() and a close() method 4002 (underlyingly py.io.StdCapture/FD objects are used which grew a 4003 readouterr() method as well to return snapshots of captured out/err) 4004 4005* make assert-reinterpretation work better with comparisons not 4006 returning bools (reported with numpy from thanks maciej fijalkowski) 4007 4008* reworked per-test output capturing into the pytest_iocapture.py plugin 4009 and thus removed capturing code from config object 4010 4011* item.repr_failure(excinfo) instead of item.repr_failure(excinfo, outerr) 4012 4013 40141.0.0b8 (2009-07-22) 4015==================== 4016 4017* pytest_unittest-plugin is now enabled by default 4018 4019* introduced pytest_keyboardinterrupt hook and 4020 refined pytest_sessionfinish hooked, added tests. 4021 4022* workaround a buggy logging module interaction ("closing already closed 4023 files"). Thanks to Sridhar Ratnakumar for triggering. 4024 4025* if plugins use "py.test.importorskip" for importing 4026 a dependency only a warning will be issued instead 4027 of exiting the testing process. 4028 4029* many improvements to docs: 4030 - refined funcargs doc , use the term "factory" instead of "provider" 4031 - added a new talk/tutorial doc page 4032 - better download page 4033 - better plugin docstrings 4034 - added new plugins page and automatic doc generation script 4035 4036* fixed teardown problem related to partially failing funcarg setups 4037 (thanks MrTopf for reporting), "pytest_runtest_teardown" is now 4038 always invoked even if the "pytest_runtest_setup" failed. 4039 4040* tweaked doctest output for docstrings in py modules, 4041 thanks Radomir. 4042 40431.0.0b7 4044======= 4045 4046* renamed py.test.xfail back to py.test.mark.xfail to avoid 4047 two ways to decorate for xfail 4048 4049* re-added py.test.mark decorator for setting keywords on functions 4050 (it was actually documented so removing it was not nice) 4051 4052* remove scope-argument from request.addfinalizer() because 4053 request.cached_setup has the scope arg. TOOWTDI. 4054 4055* perform setup finalization before reporting failures 4056 4057* apply modified patches from Andreas Kloeckner to allow 4058 test functions to have no func_code (#22) and to make 4059 "-k" and function keywords work (#20) 4060 4061* apply patch from Daniel Peolzleithner (issue #23) 4062 4063* resolve issue #18, multiprocessing.Manager() and 4064 redirection clash 4065 4066* make __name__ == "__channelexec__" for remote_exec code 4067 40681.0.0b3 (2009-06-19) 4069==================== 4070 4071* plugin classes are removed: one now defines 4072 hooks directly in conftest.py or global pytest_*.py 4073 files. 4074 4075* added new pytest_namespace(config) hook that allows 4076 to inject helpers directly to the py.test.* namespace. 4077 4078* documented and refined many hooks 4079 4080* added new style of generative tests via 4081 pytest_generate_tests hook that integrates 4082 well with function arguments. 4083 4084 40851.0.0b1 4086======= 4087 4088* introduced new "funcarg" setup method, 4089 see doc/test/funcarg.txt 4090 4091* introduced plugin architecture and many 4092 new py.test plugins, see 4093 doc/test/plugins.txt 4094 4095* teardown_method is now guaranteed to get 4096 called after a test method has run. 4097 4098* new method: py.test.importorskip(mod,minversion) 4099 will either import or call py.test.skip() 4100 4101* completely revised internal py.test architecture 4102 4103* new py.process.ForkedFunc object allowing to 4104 fork execution of a function to a sub process 4105 and getting a result back. 4106 4107XXX lots of things missing here XXX 4108 41090.9.2 4110===== 4111 4112* refined installation and metadata, created new setup.py, 4113 now based on setuptools/ez_setup (thanks to Ralf Schmitt 4114 for his support). 4115 4116* improved the way of making py.* scripts available in 4117 windows environments, they are now added to the 4118 Scripts directory as ".cmd" files. 4119 4120* py.path.svnwc.status() now is more complete and 4121 uses xml output from the 'svn' command if available 4122 (Guido Wesdorp) 4123 4124* fix for py.path.svn* to work with svn 1.5 4125 (Chris Lamb) 4126 4127* fix path.relto(otherpath) method on windows to 4128 use normcase for checking if a path is relative. 4129 4130* py.test's traceback is better parseable from editors 4131 (follows the filenames:LINENO: MSG convention) 4132 (thanks to Osmo Salomaa) 4133 4134* fix to javascript-generation, "py.test --runbrowser" 4135 should work more reliably now 4136 4137* removed previously accidentally added 4138 py.test.broken and py.test.notimplemented helpers. 4139 4140* there now is a py.__version__ attribute 4141 41420.9.1 4143===== 4144 4145This is a fairly complete list of v0.9.1, which can 4146serve as a reference for developers. 4147 4148* allowing + signs in py.path.svn urls [39106] 4149* fixed support for Failed exceptions without excinfo in py.test [39340] 4150* added support for killing processes for Windows (as well as platforms that 4151 support os.kill) in py.misc.killproc [39655] 4152* added setup/teardown for generative tests to py.test [40702] 4153* added detection of FAILED TO LOAD MODULE to py.test [40703, 40738, 40739] 4154* fixed problem with calling .remove() on wcpaths of non-versioned files in 4155 py.path [44248] 4156* fixed some import and inheritance issues in py.test [41480, 44648, 44655] 4157* fail to run greenlet tests when pypy is available, but without stackless 4158 [45294] 4159* small fixes in rsession tests [45295] 4160* fixed issue with 2.5 type representations in py.test [45483, 45484] 4161* made that internal reporting issues displaying is done atomically in py.test 4162 [45518] 4163* made that non-existing files are ignored by the py.lookup script [45519] 4164* improved exception name creation in py.test [45535] 4165* made that less threads are used in execnet [merge in 45539] 4166* removed lock required for atomic reporting issue displaying in py.test 4167 [45545] 4168* removed globals from execnet [45541, 45547] 4169* refactored cleanup mechanics, made that setDaemon is set to 1 to make atexit 4170 get called in 2.5 (py.execnet) [45548] 4171* fixed bug in joining threads in py.execnet's servemain [45549] 4172* refactored py.test.rsession tests to not rely on exact output format anymore 4173 [45646] 4174* using repr() on test outcome [45647] 4175* added 'Reason' classes for py.test.skip() [45648, 45649] 4176* killed some unnecessary sanity check in py.test.collect [45655] 4177* avoid using os.tmpfile() in py.io.fdcapture because on Windows it's only 4178 usable by Administrators [45901] 4179* added support for locking and non-recursive commits to py.path.svnwc [45994] 4180* locking files in py.execnet to prevent CPython from segfaulting [46010] 4181* added export() method to py.path.svnurl 4182* fixed -d -x in py.test [47277] 4183* fixed argument concatenation problem in py.path.svnwc [49423] 4184* restore py.test behaviour that it exits with code 1 when there are failures 4185 [49974] 4186* don't fail on html files that don't have an accompanying .txt file [50606] 4187* fixed 'utestconvert.py < input' [50645] 4188* small fix for code indentation in py.code.source [50755] 4189* fix _docgen.py documentation building [51285] 4190* improved checks for source representation of code blocks in py.test [51292] 4191* added support for passing authentication to py.path.svn* objects [52000, 4192 52001] 4193* removed sorted() call for py.apigen tests in favour of [].sort() to support 4194 Python 2.3 [52481] 4195