|
8 | 8 |
|
9 | 9 | .. towncrier release notes start
|
10 | 10 |
|
| 11 | +Pytest 3.5.0 (2018-03-21) |
| 12 | +========================= |
| 13 | + |
| 14 | +Deprecations and Removals |
| 15 | +------------------------- |
| 16 | + |
| 17 | +- ``record_xml_property`` fixture is now deprecated in favor of the more |
| 18 | + generic ``record_property``. (`#2770 |
| 19 | + <https://github.com/pytest-dev/pytest/issues/2770>`_) |
| 20 | + |
| 21 | +- Defining ``pytest_plugins`` is now deprecated in non-top-level conftest.py |
| 22 | + files, because they "leak" to the entire directory tree. (`#3084 |
| 23 | + <https://github.com/pytest-dev/pytest/issues/3084>`_) |
| 24 | + |
| 25 | + |
| 26 | +Features |
| 27 | +-------- |
| 28 | + |
| 29 | +- New ``--show-capture`` command-line option that allows to specify how to |
| 30 | + display captured output when tests fail: ``no``, ``stdout``, ``stderr``, |
| 31 | + ``log`` or ``all`` (the default). (`#1478 |
| 32 | + <https://github.com/pytest-dev/pytest/issues/1478>`_) |
| 33 | + |
| 34 | +- New ``--rootdir`` command-line option to override the rules for discovering |
| 35 | + the root directory. See `customize |
| 36 | + <https://docs.pytest.org/en/latest/customize.html>`_ in the documentation for |
| 37 | + details. (`#1642 <https://github.com/pytest-dev/pytest/issues/1642>`_) |
| 38 | + |
| 39 | +- Fixtures are now instantiated based on their scopes, with higher-scoped |
| 40 | + fixtures (such as ``session``) being instantiated first than lower-scoped |
| 41 | + fixtures (such as ``function``). The relative order of fixtures of the same |
| 42 | + scope is kept unchanged, based in their declaration order and their |
| 43 | + dependencies. (`#2405 <https://github.com/pytest-dev/pytest/issues/2405>`_) |
| 44 | + |
| 45 | +- ``record_xml_property`` renamed to ``record_property`` and is now compatible |
| 46 | + with xdist, markers and any reporter. ``record_xml_property`` name is now |
| 47 | + deprecated. (`#2770 <https://github.com/pytest-dev/pytest/issues/2770>`_) |
| 48 | + |
| 49 | +- New ``--nf``, ``--new-first`` options: run new tests first followed by the |
| 50 | + rest of the tests, in both cases tests are also sorted by the file modified |
| 51 | + time, with more recent files coming first. (`#3034 |
| 52 | + <https://github.com/pytest-dev/pytest/issues/3034>`_) |
| 53 | + |
| 54 | +- New ``--last-failed-no-failures`` command-line option that allows to specify |
| 55 | + the behavior of the cache plugin's ```--last-failed`` feature when no tests |
| 56 | + failed in the last run (or no cache was found): ``none`` or ``all`` (the |
| 57 | + default). (`#3139 <https://github.com/pytest-dev/pytest/issues/3139>`_) |
| 58 | + |
| 59 | +- New ``--doctest-continue-on-failure`` command-line option to enable doctests |
| 60 | + to show multiple failures for each snippet, instead of stopping at the first |
| 61 | + failure. (`#3149 <https://github.com/pytest-dev/pytest/issues/3149>`_) |
| 62 | + |
| 63 | +- Captured log messages are added to the ``<system-out>`` tag in the generated |
| 64 | + junit xml file if the ``junit_logging`` ini option is set to ``system-out``. |
| 65 | + If the value of this ini option is ``system-err`, the logs are written to |
| 66 | + ``<system-err>``. The default value for ``junit_logging`` is ``no``, meaning |
| 67 | + captured logs are not written to the output file. (`#3156 |
| 68 | + <https://github.com/pytest-dev/pytest/issues/3156>`_) |
| 69 | + |
| 70 | +- Allow the logging plugin to handle ``pytest_runtest_logstart`` and |
| 71 | + ``pytest_runtest_logfinish`` hooks when live logs are enabled. (`#3189 |
| 72 | + <https://github.com/pytest-dev/pytest/issues/3189>`_) |
| 73 | + |
| 74 | +- Passing `--log-cli-level` in the command-line now automatically activates |
| 75 | + live logging. (`#3190 <https://github.com/pytest-dev/pytest/issues/3190>`_) |
| 76 | + |
| 77 | +- Add command line option ``--deselect`` to allow deselection of individual |
| 78 | + tests at collection time. (`#3198 |
| 79 | + <https://github.com/pytest-dev/pytest/issues/3198>`_) |
| 80 | + |
| 81 | +- Captured logs are printed before entering pdb. (`#3204 |
| 82 | + <https://github.com/pytest-dev/pytest/issues/3204>`_) |
| 83 | + |
| 84 | +- Deselected item count is now shown before tests are run, e.g. ``collected X |
| 85 | + items / Y deselected``. (`#3213 |
| 86 | + <https://github.com/pytest-dev/pytest/issues/3213>`_) |
| 87 | + |
| 88 | +- The builtin module ``platform`` is now available for use in expressions in |
| 89 | + ``pytest.mark``. (`#3236 |
| 90 | + <https://github.com/pytest-dev/pytest/issues/3236>`_) |
| 91 | + |
| 92 | +- The *short test summary info* section now is displayed after tracebacks and |
| 93 | + warnings in the terminal. (`#3255 |
| 94 | + <https://github.com/pytest-dev/pytest/issues/3255>`_) |
| 95 | + |
| 96 | +- New ``--verbosity`` flag to set verbosity level explicitly. (`#3296 |
| 97 | + <https://github.com/pytest-dev/pytest/issues/3296>`_) |
| 98 | + |
| 99 | +- ``pytest.approx`` now accepts comparing a numpy array with a scalar. (`#3312 |
| 100 | + <https://github.com/pytest-dev/pytest/issues/3312>`_) |
| 101 | + |
| 102 | + |
| 103 | +Bug Fixes |
| 104 | +--------- |
| 105 | + |
| 106 | +- Suppress ``IOError`` when closing the temporary file used for capturing |
| 107 | + streams in Python 2.7. (`#2370 |
| 108 | + <https://github.com/pytest-dev/pytest/issues/2370>`_) |
| 109 | + |
| 110 | +- Fixed ``clear()`` method on ``caplog`` fixture which cleared ``records``, but |
| 111 | + not the ``text`` property. (`#3297 |
| 112 | + <https://github.com/pytest-dev/pytest/issues/3297>`_) |
| 113 | + |
| 114 | +- During test collection, when stdin is not allowed to be read, the |
| 115 | + ``DontReadFromStdin`` object still allow itself to be iterable and resolved |
| 116 | + to an iterator without crashing. (`#3314 |
| 117 | + <https://github.com/pytest-dev/pytest/issues/3314>`_) |
| 118 | + |
| 119 | + |
| 120 | +Improved Documentation |
| 121 | +---------------------- |
| 122 | + |
| 123 | +- Added a `reference <https://docs.pytest.org/en/latest/reference.html>`_ page |
| 124 | + to the docs. (`#1713 <https://github.com/pytest-dev/pytest/issues/1713>`_) |
| 125 | + |
| 126 | + |
| 127 | +Trivial/Internal Changes |
| 128 | +------------------------ |
| 129 | + |
| 130 | +- Change minimum requirement of ``attrs`` to ``17.4.0``. (`#3228 |
| 131 | + <https://github.com/pytest-dev/pytest/issues/3228>`_) |
| 132 | + |
| 133 | +- Renamed example directories so all tests pass when ran from the base |
| 134 | + directory. (`#3245 <https://github.com/pytest-dev/pytest/issues/3245>`_) |
| 135 | + |
| 136 | +- Internal ``mark.py`` module has been turned into a package. (`#3250 |
| 137 | + <https://github.com/pytest-dev/pytest/issues/3250>`_) |
| 138 | + |
| 139 | +- ``pytest`` now depends on the `more_itertools |
| 140 | + <https://github.com/erikrose/more-itertools>`_ package. (`#3265 |
| 141 | + <https://github.com/pytest-dev/pytest/issues/3265>`_) |
| 142 | + |
| 143 | +- Added warning when ``[pytest]`` section is used in a ``.cfg`` file passed |
| 144 | + with ``-c`` (`#3268 <https://github.com/pytest-dev/pytest/issues/3268>`_) |
| 145 | + |
| 146 | +- ``nodeids`` can now be passed explicitly to ``FSCollector`` and ``Node`` |
| 147 | + constructors. (`#3291 <https://github.com/pytest-dev/pytest/issues/3291>`_) |
| 148 | + |
| 149 | +- Internal refactoring of ``FormattedExcinfo`` to use ``attrs`` facilities and |
| 150 | + remove old support code for legacy Python versions. (`#3292 |
| 151 | + <https://github.com/pytest-dev/pytest/issues/3292>`_) |
| 152 | + |
| 153 | +- Refactoring to unify how verbosity is handled internally. (`#3296 |
| 154 | + <https://github.com/pytest-dev/pytest/issues/3296>`_) |
| 155 | + |
| 156 | +- Internal refactoring to better integrate with argparse. (`#3304 |
| 157 | + <https://github.com/pytest-dev/pytest/issues/3304>`_) |
| 158 | + |
| 159 | +- Fix a python example when calling a fixture in doc/en/usage.rst (`#3308 |
| 160 | + <https://github.com/pytest-dev/pytest/issues/3308>`_) |
| 161 | + |
| 162 | + |
11 | 163 | Pytest 3.4.2 (2018-03-04)
|
12 | 164 | =========================
|
13 | 165 |
|
|
0 commit comments