=========================
Deprecations and Removals
-------------------------
- ``pytest.approx`` no longer supports ``>``, ``>=``, ``<`` and ``<=``
operators to avoid surprising/inconsistent behavior. See the :func:`~pytest.approx` docs for more
information. (:issue:`2003`)
- All old-style specific behavior in current classes in the pytest's API is
considered deprecated at this point and will be removed in a future release.
This affects Python 2 users only and in rare situations. (:issue:`2147`)
- A deprecation warning is now raised when using marks for parameters
in ``pytest.mark.parametrize``. Use ``pytest.param`` to apply marks to
parameters instead. (:issue:`2427`)
Features
--------
- Add support for numpy arrays (and dicts) to approx. (:issue:`1994`)
- Now test function objects have a ``pytestmark`` attribute containing a list
of marks applied directly to the test function, as opposed to marks inherited
from parent classes or modules. (:issue:`2516`)
- Collection ignores local virtualenvs by default; ``--collect-in-virtualenv``
overrides this behavior. (:issue:`2518`)
- Allow class methods decorated as ``staticmethod`` to be candidates for
collection as a test function. (Only for Python 2.7 and above. Python 2.6
will still ignore static methods.) (:issue:`2528`)
- Introduce ``mark.with_args`` in order to allow passing functions/classes as
sole argument to marks. (:issue:`2540`)
- New ``cache_dir`` ini option: sets the directory where the contents of the
cache plugin are stored. Directory may be relative or absolute path: if relative path, then
directory is created relative to ``rootdir``, otherwise it is used as is.
Additionally path may contain environment variables which are expanded during
runtime. (:issue:`2543`)
- Introduce the ``PYTEST_CURRENT_TEST`` environment variable that is set with
the ``nodeid`` and stage (``setup``, ``call`` and ``teardown``) of the test
being currently executed. See the :ref:`documentation <pytest current test env>`
for more info. (:issue:`2583`)
- Introduced ``pytest.mark.filterwarnings`` mark which allows overwriting the
warnings filter on a per test, class or module level. See the :ref:`docs <filterwarnings>`
for more information. (:issue:`2598`)
- ``--last-failed`` now remembers forever when a test has failed and only
forgets it if it passes again. This makes it easy to fix a test suite by
selectively running files and fixing tests incrementally. (:issue:`2621`)
- New ``pytest_report_collectionfinish`` hook which allows plugins to add
messages to the terminal reporting after collection has been finished
successfully. (:issue:`2622`)
- Added support for :pep:`415`\'s
``Exception.__suppress_context__``. Now if a ``raise exception from None`` is
caught by pytest, pytest will no longer chain the context in the test report.
The behavior now matches Python's traceback behavior. (:issue:`2631`)
- Exceptions raised by ``pytest.fail``, ``pytest.skip`` and ``pytest.xfail``
now subclass BaseException, making them harder to be caught unintentionally
by normal code. (:issue:`580`)
Bug Fixes
---------
- Set ``stdin`` to a closed ``PIPE`` in ``pytester.py.Testdir.popen()`` for
avoid unwanted interactive ``pdb`` (:issue:`2023`)
- Add missing ``encoding`` attribute to ``sys.std*`` streams when using
``capsys`` capture mode. (:issue:`2375`)
- Fix terminal color changing to black on Windows if ``colorama`` is imported
in a ``conftest.py`` file. (:issue:`2510`)
- Fix line number when reporting summary of skipped tests. (:issue:`2548`)
- capture: ensure that EncodedFile.name is a string. (:issue:`2555`)
- The options ``--fixtures`` and ``--fixtures-per-test`` will now keep
indentation within docstrings. (:issue:`2574`)
- doctests line numbers are now reported correctly, fixing `pytest-sugar122
<https://github.com/Frozenball/pytest-sugar/issues/122>`_. (:issue:`2610`)
- Fix non-determinism in order of fixture collection. Adds new dependency
(ordereddict) for Python 2.6. (:issue:`920`)
Improved Documentation
----------------------
- Clarify ``pytest_configure`` hook call order. (:issue:`2539`)
- Extend documentation for testing plugin code with the ``pytester`` plugin.
(:issue:`971`)
Trivial/Internal Changes
------------------------
- Update help message for ``--strict`` to make it clear it only deals with
unregistered markers, not warnings. (:issue:`2444`)
- Internal code move: move code for pytest.approx/pytest.raises to own files in
order to cut down the size of python.py (:issue:`2489`)
- Renamed the utility function ``_pytest.compat._escape_strings`` to
``_ascii_escaped`` to better communicate the function's purpose. (:issue:`2533`)
- Improve error message for CollectError with skip/skipif. (:issue:`2546`)
- Emit warning about ``yield`` tests being deprecated only once per generator.
(:issue:`2562`)
- Ensure final collected line doesn't include artifacts of previous write.
(:issue:`2571`)
- Fixed all flake8 errors and warnings. (:issue:`2581`)
- Added ``fix-lint`` tox environment to run automatic pep8 fixes on the code.
(:issue:`2582`)
- Turn warnings into errors in pytest's own test suite in order to catch
regressions due to deprecations more promptly. (:issue:`2588`)
- Show multiple issue links in CHANGELOG entries. (:issue:`2620`)