Skip to content

Commit

Permalink
Merge pull request pytest-dev#4697 from nicoddemus/merge-master-into-…
Browse files Browse the repository at this point in the history
…features

Merge master into features
  • Loading branch information
nicoddemus authored Jan 31, 2019
2 parents e2a15c7 + 7dcd9bf commit 2461a43
Show file tree
Hide file tree
Showing 40 changed files with 222 additions and 80 deletions.
78 changes: 78 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,84 @@ with advance notice in the **Deprecations** section of releases.
.. towncrier release notes start
pytest 4.2.0 (2019-01-30)
=========================

Features
--------

- `#3094 <https://github.com/pytest-dev/pytest/issues/3094>`_: `Class xunit-style <https://docs.pytest.org/en/latest/xunit_setup.html>`__ functions and methods
now obey the scope of *autouse* fixtures.

This fixes a number of surprising issues like ``setup_method`` being called before session-scoped
autouse fixtures (see `#517 <https://github.com/pytest-dev/pytest/issues/517>`__ for an example).


- `#4627 <https://github.com/pytest-dev/pytest/issues/4627>`_: Display a message at the end of the test session when running under Python 2.7 and 3.4 that pytest 5.0 will no longer
support those Python versions.


- `#4660 <https://github.com/pytest-dev/pytest/issues/4660>`_: The number of *selected* tests now are also displayed when the ``-k`` or ``-m`` flags are used.


- `#4688 <https://github.com/pytest-dev/pytest/issues/4688>`_: ``pytest_report_teststatus`` hook now can also receive a ``config`` parameter.


- `#4691 <https://github.com/pytest-dev/pytest/issues/4691>`_: ``pytest_terminal_summary`` hook now can also receive a ``config`` parameter.



Bug Fixes
---------

- `#3547 <https://github.com/pytest-dev/pytest/issues/3547>`_: ``--junitxml`` can emit XML compatible with Jenkins xUnit.
``junit_family`` INI option accepts ``legacy|xunit1``, which produces old style output, and ``xunit2`` that conforms more strictly to https://github.com/jenkinsci/xunit-plugin/blob/xunit-2.3.2/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd


- `#4280 <https://github.com/pytest-dev/pytest/issues/4280>`_: Improve quitting from pdb, especially with ``--trace``.

Using ``q[quit]`` after ``pdb.set_trace()`` will quit pytest also.


- `#4402 <https://github.com/pytest-dev/pytest/issues/4402>`_: Warning summary now groups warnings by message instead of by test id.

This makes the output more compact and better conveys the general idea of how much code is
actually generating warnings, instead of how many tests call that code.


- `#4536 <https://github.com/pytest-dev/pytest/issues/4536>`_: ``monkeypatch.delattr`` handles class descriptors like ``staticmethod``/``classmethod``.


- `#4649 <https://github.com/pytest-dev/pytest/issues/4649>`_: Restore marks being considered keywords for keyword expressions.


- `#4653 <https://github.com/pytest-dev/pytest/issues/4653>`_: ``tmp_path`` fixture and other related ones provides resolved path (a.k.a real path)


- `#4667 <https://github.com/pytest-dev/pytest/issues/4667>`_: ``pytest_terminal_summary`` uses result from ``pytest_report_teststatus`` hook, rather than hardcoded strings.


- `#4669 <https://github.com/pytest-dev/pytest/issues/4669>`_: Correctly handle ``unittest.SkipTest`` exception containing non-ascii characters on Python 2.


- `#4680 <https://github.com/pytest-dev/pytest/issues/4680>`_: Ensure the ``tmpdir`` and the ``tmp_path`` fixtures are the same folder.


- `#4681 <https://github.com/pytest-dev/pytest/issues/4681>`_: Ensure ``tmp_path`` is always a real path.



Trivial/Internal Changes
------------------------

- `#4643 <https://github.com/pytest-dev/pytest/issues/4643>`_: Use ``a.item()`` instead of the deprecated ``np.asscalar(a)`` in ``pytest.approx``.

``np.asscalar`` has been `deprecated <https://github.com/numpy/numpy/blob/master/doc/release/1.16.0-notes.rst#new-deprecations>`__ in ``numpy 1.16.``.


- `#4657 <https://github.com/pytest-dev/pytest/issues/4657>`_: Copy saferepr from pylib


pytest 4.1.1 (2019-01-12)
=========================

Expand Down
5 changes: 0 additions & 5 deletions changelog/3094.feature.rst

This file was deleted.

2 changes: 0 additions & 2 deletions changelog/3547.bugfix.rst

This file was deleted.

3 changes: 0 additions & 3 deletions changelog/4280.bugfix.rst

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/4402.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/4536.bugfix.rst

This file was deleted.

2 changes: 0 additions & 2 deletions changelog/4627.feature.rst

This file was deleted.

3 changes: 0 additions & 3 deletions changelog/4643.trivial.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/4649.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/4653.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/4657.trivial.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/4660.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/4667.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/4669.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/4680.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/4681.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/4688.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/4691.feature.rst

This file was deleted.

1 change: 1 addition & 0 deletions doc/en/announce/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Release announcements
:maxdepth: 2


release-4.2.0
release-4.1.1
release-4.1.0
release-4.0.2
Expand Down
37 changes: 37 additions & 0 deletions doc/en/announce/release-4.2.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
pytest-4.2.0
=======================================

The pytest team is proud to announce the 4.2.0 release!

pytest is a mature Python testing tool with more than a 2000 tests
against itself, passing on many different interpreters and platforms.

This release contains a number of bugs fixes and improvements, so users are encouraged
to take a look at the CHANGELOG:

https://docs.pytest.org/en/latest/changelog.html

For complete documentation, please visit:

https://docs.pytest.org/en/latest/

As usual, you can upgrade from pypi via:

pip install -U pytest

Thanks to all who contributed to this release, among them:

* Adam Uhlir
* Anthony Sottile
* Bruno Oliveira
* Christopher Dignam
* Daniel Hahler
* Joseph Hunkeler
* Kristoffer Nordstroem
* Ronny Pfannschmidt
* Thomas Hisch
* wim glenn


Happy testing,
The Pytest Development Team
2 changes: 2 additions & 0 deletions doc/en/assert.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ you will see the return value of the function call:
$ pytest test_assert1.py
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y
cachedir: $PYTHON_PREFIX/.pytest_cache
rootdir: $REGENDOC_TMPDIR, inifile:
collected 1 item
Expand Down Expand Up @@ -173,6 +174,7 @@ if you run this module:
$ pytest test_assert2.py
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y
cachedir: $PYTHON_PREFIX/.pytest_cache
rootdir: $REGENDOC_TMPDIR, inifile:
collected 1 item
Expand Down
14 changes: 11 additions & 3 deletions doc/en/cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ If you then run it with ``--lf``:
$ pytest --lf
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y
cachedir: $PYTHON_PREFIX/.pytest_cache
rootdir: $REGENDOC_TMPDIR, inifile:
collected 50 items / 48 deselected
collected 50 items / 48 deselected / 2 selected
run-last-failure: rerun previous 2 failures
test_50.py FF [100%]
Expand Down Expand Up @@ -124,6 +125,7 @@ of ``FF`` and dots):
$ pytest --ff
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y
cachedir: $PYTHON_PREFIX/.pytest_cache
rootdir: $REGENDOC_TMPDIR, inifile:
collected 50 items
run-last-failure: rerun previous 2 failures first
Expand Down Expand Up @@ -257,11 +259,17 @@ You can always peek at the content of the cache using the
$ pytest --cache-show
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y
cachedir: $PYTHON_PREFIX/.pytest_cache
rootdir: $REGENDOC_TMPDIR, inifile:
cachedir: $REGENDOC_TMPDIR/.pytest_cache
cachedir: $PYTHON_PREFIX/.pytest_cache
------------------------------- cache values -------------------------------
cache/lastfailed contains:
{'test_caching.py::test_function': True}
{'test_50.py::test_num[17]': True,
'test_50.py::test_num[25]': True,
'test_assert1.py::test_function': True,
'test_assert2.py::test_set_comparison': True,
'test_caching.py::test_function': True,
'test_foocompare.py::test_compare': True}
cache/nodeids contains:
['test_caching.py::test_function']
cache/stepwise contains:
Expand Down
1 change: 1 addition & 0 deletions doc/en/capture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ of the failing function and hide the other one:
$ pytest
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y
cachedir: $PYTHON_PREFIX/.pytest_cache
rootdir: $REGENDOC_TMPDIR, inifile:
collected 2 items
Expand Down
1 change: 1 addition & 0 deletions doc/en/doctest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ then you can just invoke ``pytest`` without command line options:
$ pytest
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-4.x.y, py-1.x.y, pluggy-0.x.y
cachedir: $PYTHON_PREFIX/.pytest_cache
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
collected 1 item
Expand Down
Loading

0 comments on commit 2461a43

Please sign in to comment.