|
8 | 8 |
|
9 | 9 | .. towncrier release notes start |
10 | 10 |
|
| 11 | +Pytest 3.4.0 (2018-01-30) |
| 12 | +========================= |
| 13 | + |
| 14 | +Deprecations and Removals |
| 15 | +------------------------- |
| 16 | + |
| 17 | +- All pytest classes now subclass ``object`` for better Python 2/3 compatibility. |
| 18 | + This should not affect user code except in very rare edge cases. (`#2147 |
| 19 | + <https://github.com/pytest-dev/pytest/issues/2147>`_) |
| 20 | + |
| 21 | + |
| 22 | +Features |
| 23 | +-------- |
| 24 | + |
| 25 | +- Introduce ``empty_parameter_set_mark`` ini option to select which mark to |
| 26 | + apply when ``@pytest.mark.parametrize`` is given an empty set of parameters. |
| 27 | + Valid options are ``skip`` (default) and ``xfail``. Note that it is planned |
| 28 | + to change the default to ``xfail`` in future releases as this is considered |
| 29 | + less error prone. (`#2527 |
| 30 | + <https://github.com/pytest-dev/pytest/issues/2527>`_) |
| 31 | + |
| 32 | +- **Incompatible change**: after community feedback the `logging |
| 33 | + <https://docs.pytest.org/en/latest/logging.html>`_ functionality has |
| 34 | + undergone some changes. Please consult the `logging documentation |
| 35 | + <https://docs.pytest.org/en/latest/logging.html#incompatible-changes-in-pytest-3-4>`_ |
| 36 | + for details. (`#3013 <https://github.com/pytest-dev/pytest/issues/3013>`_) |
| 37 | + |
| 38 | +- Console output falls back to "classic" mode when capturing is disabled (``-s``), |
| 39 | + otherwise the output gets garbled to the point of being useless. (`#3038 |
| 40 | + <https://github.com/pytest-dev/pytest/issues/3038>`_) |
| 41 | + |
| 42 | +- New `pytest_runtest_logfinish |
| 43 | + <https://docs.pytest.org/en/latest/writing_plugins.html#_pytest.hookspec.pytest_runtest_logfinish>`_ |
| 44 | + hook which is called when a test item has finished executing, analogous to |
| 45 | + `pytest_runtest_logstart |
| 46 | + <https://docs.pytest.org/en/latest/writing_plugins.html#_pytest.hookspec.pytest_runtest_start>`_. |
| 47 | + (`#3101 <https://github.com/pytest-dev/pytest/issues/3101>`_) |
| 48 | + |
| 49 | +- Improve performance when collecting tests using many fixtures. (`#3107 |
| 50 | + <https://github.com/pytest-dev/pytest/issues/3107>`_) |
| 51 | + |
| 52 | +- New ``caplog.get_records(when)`` method which provides access to the captured |
| 53 | + records for the ``"setup"``, ``"call"`` and ``"teardown"`` |
| 54 | + testing stages. (`#3117 <https://github.com/pytest-dev/pytest/issues/3117>`_) |
| 55 | + |
| 56 | +- New fixture ``record_xml_attribute`` that allows modifying and inserting |
| 57 | + attributes on the ``<testcase>`` xml node in JUnit reports. (`#3130 |
| 58 | + <https://github.com/pytest-dev/pytest/issues/3130>`_) |
| 59 | + |
| 60 | +- The default cache directory has been renamed from ``.cache`` to |
| 61 | + ``.pytest_cache`` after community feedback that the name ``.cache`` did not |
| 62 | + make it clear that it was used by pytest. (`#3138 |
| 63 | + <https://github.com/pytest-dev/pytest/issues/3138>`_) |
| 64 | + |
| 65 | +- Colorize the levelname column in the live-log output. (`#3142 |
| 66 | + <https://github.com/pytest-dev/pytest/issues/3142>`_) |
| 67 | + |
| 68 | + |
| 69 | +Bug Fixes |
| 70 | +--------- |
| 71 | + |
| 72 | +- Fix hanging pexpect test on MacOS by using flush() instead of wait(). |
| 73 | + (`#2022 <https://github.com/pytest-dev/pytest/issues/2022>`_) |
| 74 | + |
| 75 | +- Fix restoring Python state after in-process pytest runs with the |
| 76 | + ``pytester`` plugin; this may break tests using multiple inprocess |
| 77 | + pytest runs if later ones depend on earlier ones leaking global interpreter |
| 78 | + changes. (`#3016 <https://github.com/pytest-dev/pytest/issues/3016>`_) |
| 79 | + |
| 80 | +- Fix skipping plugin reporting hook when test aborted before plugin setup |
| 81 | + hook. (`#3074 <https://github.com/pytest-dev/pytest/issues/3074>`_) |
| 82 | + |
| 83 | +- Fix progress percentage reported when tests fail during teardown. (`#3088 |
| 84 | + <https://github.com/pytest-dev/pytest/issues/3088>`_) |
| 85 | + |
| 86 | +- **Incompatible change**: ``-o/--override`` option no longer eats all the |
| 87 | + remaining options, which can lead to surprising behavior: for example, |
| 88 | + ``pytest -o foo=1 /path/to/test.py`` would fail because ``/path/to/test.py`` |
| 89 | + would be considered as part of the ``-o`` command-line argument. One |
| 90 | + consequence of this is that now multiple configuration overrides need |
| 91 | + multiple ``-o`` flags: ``pytest -o foo=1 -o bar=2``. (`#3103 |
| 92 | + <https://github.com/pytest-dev/pytest/issues/3103>`_) |
| 93 | + |
| 94 | + |
| 95 | +Improved Documentation |
| 96 | +---------------------- |
| 97 | + |
| 98 | +- Document hooks (defined with ``historic=True``) which cannot be used with |
| 99 | + ``hookwrapper=True``. (`#2423 |
| 100 | + <https://github.com/pytest-dev/pytest/issues/2423>`_) |
| 101 | + |
| 102 | +- Clarify that warning capturing doesn't change the warning filter by default. |
| 103 | + (`#2457 <https://github.com/pytest-dev/pytest/issues/2457>`_) |
| 104 | + |
| 105 | +- Clarify a possible confusion when using pytest_fixture_setup with fixture |
| 106 | + functions that return None. (`#2698 |
| 107 | + <https://github.com/pytest-dev/pytest/issues/2698>`_) |
| 108 | + |
| 109 | +- Fix the wording of a sentence on doctest flags used in pytest. (`#3076 |
| 110 | + <https://github.com/pytest-dev/pytest/issues/3076>`_) |
| 111 | + |
| 112 | +- Prefer ``https://*.readthedocs.io`` over ``http://*.rtfd.org`` for links in |
| 113 | + the documentation. (`#3092 |
| 114 | + <https://github.com/pytest-dev/pytest/issues/3092>`_) |
| 115 | + |
| 116 | +- Improve readability (wording, grammar) of Getting Started guide (`#3131 |
| 117 | + <https://github.com/pytest-dev/pytest/issues/3131>`_) |
| 118 | + |
| 119 | +- Added note that calling pytest.main multiple times from the same process is |
| 120 | + not recommended because of import caching. (`#3143 |
| 121 | + <https://github.com/pytest-dev/pytest/issues/3143>`_) |
| 122 | + |
| 123 | + |
| 124 | +Trivial/Internal Changes |
| 125 | +------------------------ |
| 126 | + |
| 127 | +- Show a simple and easy error when keyword expressions trigger a syntax error |
| 128 | + (for example, ``"-k foo and import"`` will show an error that you can not use |
| 129 | + the ``import`` keyword in expressions). (`#2953 |
| 130 | + <https://github.com/pytest-dev/pytest/issues/2953>`_) |
| 131 | + |
| 132 | +- Change parametrized automatic test id generation to use the ``__name__`` |
| 133 | + attribute of functions instead of the fallback argument name plus counter. |
| 134 | + (`#2976 <https://github.com/pytest-dev/pytest/issues/2976>`_) |
| 135 | + |
| 136 | +- Replace py.std with stdlib imports. (`#3067 |
| 137 | + <https://github.com/pytest-dev/pytest/issues/3067>`_) |
| 138 | + |
| 139 | +- Corrected 'you' to 'your' in logging docs. (`#3129 |
| 140 | + <https://github.com/pytest-dev/pytest/issues/3129>`_) |
| 141 | + |
| 142 | + |
11 | 143 | Pytest 3.3.2 (2017-12-25) |
12 | 144 | ========================= |
13 | 145 |
|
|
0 commit comments