|
8 | 8 |
|
9 | 9 | .. towncrier release notes start
|
10 | 10 |
|
| 11 | +Pytest 3.2.0 (2017-07-30) |
| 12 | +========================= |
| 13 | + |
| 14 | +Deprecations and Removals |
| 15 | +------------------------- |
| 16 | + |
| 17 | +- ``pytest.approx`` no longer supports ``>``, ``>=``, ``<`` and ``<=`` |
| 18 | + operators to avoid surprising/inconsistent behavior. See `the docs |
| 19 | + <https://docs.pytest.org/en/latest/builtin.html#pytest.approx>`_ for more |
| 20 | + information. (`#2003 <https://github.com/pytest-dev/pytest/issues/2003>`_) |
| 21 | + |
| 22 | +- All old-style specific behavior in current classes in the pytest's API is |
| 23 | + considered deprecated at this point and will be removed in a future release. |
| 24 | + This affects Python 2 users only and in rare situations. (`#2147 |
| 25 | + <https://github.com/pytest-dev/pytest/issues/2147>`_) |
| 26 | + |
| 27 | +- A deprecation warning is now raised when using marks for parameters |
| 28 | + in ``pytest.mark.parametrize``. Use ``pytest.param`` to apply marks to |
| 29 | + parameters instead. (`#2427 <https://github.com/pytest-dev/pytest/issues/2427>`_) |
| 30 | + |
| 31 | + |
| 32 | +Features |
| 33 | +-------- |
| 34 | + |
| 35 | +- Add support for numpy arrays (and dicts) to approx. (`#1994 |
| 36 | + <https://github.com/pytest-dev/pytest/issues/1994>`_) |
| 37 | + |
| 38 | +- Now test function objects have a ``pytestmark`` attribute containing a list |
| 39 | + of marks applied directly to the test function, as opposed to marks inherited |
| 40 | + from parent classes or modules. (`#2516 <https://github.com/pytest- |
| 41 | + dev/pytest/issues/2516>`_) |
| 42 | + |
| 43 | +- Collection ignores local virtualenvs by default; `--collect-in-virtualenv` |
| 44 | + overrides this behavior. (`#2518 <https://github.com/pytest- |
| 45 | + dev/pytest/issues/2518>`_) |
| 46 | + |
| 47 | +- Allow class methods decorated as ``@staticmethod`` to be candidates for |
| 48 | + collection as a test function. (Only for Python 2.7 and above. Python 2.6 |
| 49 | + will still ignore static methods.) (`#2528 <https://github.com/pytest- |
| 50 | + dev/pytest/issues/2528>`_) |
| 51 | + |
| 52 | +- Introduce ``mark.with_args`` in order to allow passing functions/classes as |
| 53 | + sole argument to marks. (`#2540 <https://github.com/pytest- |
| 54 | + dev/pytest/issues/2540>`_) |
| 55 | + |
| 56 | +- New ``cache_dir`` ini option: sets the directory where the contents of the |
| 57 | + cache plugin are stored. Directory may be relative or absolute path: if relative path, then |
| 58 | + directory is created relative to ``rootdir``, otherwise it is used as is. |
| 59 | + Additionally path may contain environment variables which are expanded during |
| 60 | + runtime. (`#2543 <https://github.com/pytest-dev/pytest/issues/2543>`_) |
| 61 | + |
| 62 | +- Introduce the ``PYTEST_CURRENT_TEST`` environment variable that is set with |
| 63 | + the ``nodeid`` and stage (``setup``, ``call`` and ``teardown``) of the test |
| 64 | + being currently executed. See the `documentation |
| 65 | + <https://docs.pytest.org/en/latest/example/simple.html#pytest-current-test- |
| 66 | + environment-variable>`_ for more info. (`#2583 <https://github.com/pytest- |
| 67 | + dev/pytest/issues/2583>`_) |
| 68 | + |
| 69 | +- Introduced ``@pytest.mark.filterwarnings`` mark which allows overwriting the |
| 70 | + warnings filter on a per test, class or module level. See the `docs |
| 71 | + <https://docs.pytest.org/en/latest/warnings.html#pytest-mark- |
| 72 | + filterwarnings>`_ for more information. (`#2598 <https://github.com/pytest- |
| 73 | + dev/pytest/issues/2598>`_) |
| 74 | + |
| 75 | +- ``--last-failed`` now remembers forever when a test has failed and only |
| 76 | + forgets it if it passes again. This makes it easy to fix a test suite by |
| 77 | + selectively running files and fixing tests incrementally. (`#2621 |
| 78 | + <https://github.com/pytest-dev/pytest/issues/2621>`_) |
| 79 | + |
| 80 | +- New ``pytest_report_collectionfinish`` hook which allows plugins to add |
| 81 | + messages to the terminal reporting after collection has been finished |
| 82 | + successfully. (`#2622 <https://github.com/pytest-dev/pytest/issues/2622>`_) |
| 83 | + |
| 84 | +- Added support for `PEP-415's <https://www.python.org/dev/peps/pep-0415/>`_ |
| 85 | + ``Exception.__suppress_context__``. Now if a ``raise exception from None`` is |
| 86 | + caught by pytest, pytest will no longer chain the context in the test report. |
| 87 | + The behavior now matches Python's traceback behavior. (`#2631 |
| 88 | + <https://github.com/pytest-dev/pytest/issues/2631>`_) |
| 89 | + |
| 90 | +- Exceptions raised by ``pytest.fail``, ``pytest.skip`` and ``pytest.xfail`` |
| 91 | + now subclass BaseException, making them harder to be caught unintentionally |
| 92 | + by normal code. (`#580 <https://github.com/pytest-dev/pytest/issues/580>`_) |
| 93 | + |
| 94 | + |
| 95 | +Bug Fixes |
| 96 | +--------- |
| 97 | + |
| 98 | +- Set ``stdin`` to a closed ``PIPE`` in ``pytester.py.Testdir.popen()`` for |
| 99 | + avoid unwanted interactive ``pdb`` (`#2023 <https://github.com/pytest- |
| 100 | + dev/pytest/issues/2023>`_) |
| 101 | + |
| 102 | +- Add missing ``encoding`` attribute to ``sys.std*`` streams when using |
| 103 | + ``capsys`` capture mode. (`#2375 <https://github.com/pytest- |
| 104 | + dev/pytest/issues/2375>`_) |
| 105 | + |
| 106 | +- Fix terminal color changing to black on Windows if ``colorama`` is imported |
| 107 | + in a ``conftest.py`` file. (`#2510 <https://github.com/pytest- |
| 108 | + dev/pytest/issues/2510>`_) |
| 109 | + |
| 110 | +- Fix line number when reporting summary of skipped tests. (`#2548 |
| 111 | + <https://github.com/pytest-dev/pytest/issues/2548>`_) |
| 112 | + |
| 113 | +- capture: ensure that EncodedFile.name is a string. (`#2555 |
| 114 | + <https://github.com/pytest-dev/pytest/issues/2555>`_) |
| 115 | + |
| 116 | +- The options ```--fixtures`` and ```--fixtures-per-test`` will now keep |
| 117 | + indentation within docstrings. (`#2574 <https://github.com/pytest- |
| 118 | + dev/pytest/issues/2574>`_) |
| 119 | + |
| 120 | +- doctests line numbers are now reported correctly, fixing `pytest-sugar#122 |
| 121 | + <https://github.com/Frozenball/pytest-sugar/issues/122>`_. (`#2610 |
| 122 | + <https://github.com/pytest-dev/pytest/issues/2610>`_) |
| 123 | + |
| 124 | +- Fix non-determinism in order of fixture collection. Adds new dependency |
| 125 | + (ordereddict) for Python 2.6. (`#920 <https://github.com/pytest- |
| 126 | + dev/pytest/issues/920>`_) |
| 127 | + |
| 128 | + |
| 129 | +Improved Documentation |
| 130 | +---------------------- |
| 131 | + |
| 132 | +- Clarify ``pytest_configure`` hook call order. (`#2539 |
| 133 | + <https://github.com/pytest-dev/pytest/issues/2539>`_) |
| 134 | + |
| 135 | +- Extend documentation for testing plugin code with the ``pytester`` plugin. |
| 136 | + (`#971 <https://github.com/pytest-dev/pytest/issues/971>`_) |
| 137 | + |
| 138 | + |
| 139 | +Trivial/Internal Changes |
| 140 | +------------------------ |
| 141 | + |
| 142 | +- Update help message for ``--strict`` to make it clear it only deals with |
| 143 | + unregistered markers, not warnings. (`#2444 <https://github.com/pytest- |
| 144 | + dev/pytest/issues/2444>`_) |
| 145 | + |
| 146 | +- Internal code move: move code for pytest.approx/pytest.raises to own files in |
| 147 | + order to cut down the size of python.py (`#2489 <https://github.com/pytest- |
| 148 | + dev/pytest/issues/2489>`_) |
| 149 | + |
| 150 | +- Renamed the utility function ``_pytest.compat._escape_strings`` to |
| 151 | + ``_ascii_escaped`` to better communicate the function's purpose. (`#2533 |
| 152 | + <https://github.com/pytest-dev/pytest/issues/2533>`_) |
| 153 | + |
| 154 | +- Improve error message for CollectError with skip/skipif. (`#2546 |
| 155 | + <https://github.com/pytest-dev/pytest/issues/2546>`_) |
| 156 | + |
| 157 | +- Emit warning about ``yield`` tests being deprecated only once per generator. |
| 158 | + (`#2562 <https://github.com/pytest-dev/pytest/issues/2562>`_) |
| 159 | + |
| 160 | +- Ensure final collected line doesn't include artifacts of previous write. |
| 161 | + (`#2571 <https://github.com/pytest-dev/pytest/issues/2571>`_) |
| 162 | + |
| 163 | +- Fixed all flake8 errors and warnings. (`#2581 <https://github.com/pytest- |
| 164 | + dev/pytest/issues/2581>`_) |
| 165 | + |
| 166 | +- Added ``fix-lint`` tox environment to run automatic pep8 fixes on the code. |
| 167 | + (`#2582 <https://github.com/pytest-dev/pytest/issues/2582>`_) |
| 168 | + |
| 169 | +- Turn warnings into errors in pytest's own test suite in order to catch |
| 170 | + regressions due to deprecations more promptly. (`#2588 |
| 171 | + <https://github.com/pytest-dev/pytest/issues/2588>`_) |
| 172 | + |
| 173 | +- Show multiple issue links in CHANGELOG entries. (`#2620 |
| 174 | + <https://github.com/pytest-dev/pytest/issues/2620>`_) |
| 175 | + |
| 176 | + |
11 | 177 | Pytest 3.1.3 (2017-07-03)
|
12 | 178 | =========================
|
13 | 179 |
|
|
0 commit comments