From d3673c7429f00ac7dfa91180194d43fe9dd99b5c Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 2 Oct 2018 07:46:02 -0700 Subject: [PATCH] Preparing release version 3.8.2 --- CHANGELOG.rst | 52 +++++++++++++++++++++++++++++++ changelog/3539.bugfix.rst | 1 - changelog/3928.doc.rst | 1 - changelog/4034.bugfix.rst | 3 -- changelog/4036.removal.rst | 9 ------ changelog/4039.bugfix.rst | 2 -- changelog/4040.bugfix.rst | 1 - changelog/4051.bugfix.rst | 1 - changelog/4056.bugfix.rst | 4 --- doc/en/announce/index.rst | 1 + doc/en/announce/release-3.8.2.rst | 28 +++++++++++++++++ doc/en/example/markers.rst | 16 +++++----- doc/en/example/nonpython.rst | 2 +- doc/en/example/parametrize.rst | 7 ++--- doc/en/example/simple.rst | 2 +- doc/en/fixture.rst | 6 ++-- 16 files changed, 97 insertions(+), 39 deletions(-) delete mode 100644 changelog/3539.bugfix.rst delete mode 100644 changelog/3928.doc.rst delete mode 100644 changelog/4034.bugfix.rst delete mode 100644 changelog/4036.removal.rst delete mode 100644 changelog/4039.bugfix.rst delete mode 100644 changelog/4040.bugfix.rst delete mode 100644 changelog/4051.bugfix.rst delete mode 100644 changelog/4056.bugfix.rst create mode 100644 doc/en/announce/release-3.8.2.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d68a160ab..26bc28af1 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -18,6 +18,58 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 3.8.2 (2018-10-02) +========================= + +Deprecations and Removals +------------------------- + +- `#4036 `_: The ``item`` parameter of ``pytest_warning_captured`` hook is now documented as deprecated. We realized only after + the ``3.8`` release that this parameter is incompatible with ``pytest-xdist``. + + Our policy is to not deprecate features during bugfix releases, but in this case we believe it makes sense as we are + only documenting it as deprecated, without issuing warnings which might potentially break test suites. This will get + the word out that hook implementers should not use this parameter at all. + + In a future release ``item`` will always be ``None`` and will emit a proper warning when a hook implementation + makes use of it. + + + +Bug Fixes +--------- + +- `#3539 `_: Fix reload on assertion rewritten modules. + + +- `#4034 `_: The ``.user_properties`` attribute of ``TestReport`` objects is a list + of (name, value) tuples, but could sometimes be instantiated as a tuple + of tuples. It is now always a list. + + +- `#4039 `_: No longer issue warnings about using ``pytest_plugins`` in non-top-level directories when using ``--pyargs``: the + current ``--pyargs`` mechanism is not reliable and might give false negatives. + + +- `#4040 `_: Exclude empty reports for passed tests when ``-rP`` option is used. + + +- `#4051 `_: Improve error message when an invalid Python expression is passed to the ``-m`` option. + + +- `#4056 `_: ``MonkeyPatch.setenv`` and ``MonkeyPatch.delenv`` issue a warning if the environment variable name is not ``str`` on Python 2. + + In Python 2, adding ``unicode`` keys to ``os.environ`` causes problems with ``subprocess`` (and possible other modules), + making this a subtle bug specially susceptible when used with ``from __future__ import unicode_literals``. + + + +Improved Documentation +---------------------- + +- `#3928 `_: Add possible values for fixture scope to docs. + + pytest 3.8.1 (2018-09-22) ========================= diff --git a/changelog/3539.bugfix.rst b/changelog/3539.bugfix.rst deleted file mode 100644 index d0741cda9..000000000 --- a/changelog/3539.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix reload on assertion rewritten modules. diff --git a/changelog/3928.doc.rst b/changelog/3928.doc.rst deleted file mode 100644 index d61b110ae..000000000 --- a/changelog/3928.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Add possible values for fixture scope to docs. diff --git a/changelog/4034.bugfix.rst b/changelog/4034.bugfix.rst deleted file mode 100644 index 44044fb29..000000000 --- a/changelog/4034.bugfix.rst +++ /dev/null @@ -1,3 +0,0 @@ -The ``.user_properties`` attribute of ``TestReport`` objects is a list -of (name, value) tuples, but could sometimes be instantiated as a tuple -of tuples. It is now always a list. diff --git a/changelog/4036.removal.rst b/changelog/4036.removal.rst deleted file mode 100644 index a124028c4..000000000 --- a/changelog/4036.removal.rst +++ /dev/null @@ -1,9 +0,0 @@ -The ``item`` parameter of ``pytest_warning_captured`` hook is now documented as deprecated. We realized only after -the ``3.8`` release that this parameter is incompatible with ``pytest-xdist``. - -Our policy is to not deprecate features during bugfix releases, but in this case we believe it makes sense as we are -only documenting it as deprecated, without issuing warnings which might potentially break test suites. This will get -the word out that hook implementers should not use this parameter at all. - -In a future release ``item`` will always be ``None`` and will emit a proper warning when a hook implementation -makes use of it. diff --git a/changelog/4039.bugfix.rst b/changelog/4039.bugfix.rst deleted file mode 100644 index 867b29498..000000000 --- a/changelog/4039.bugfix.rst +++ /dev/null @@ -1,2 +0,0 @@ -No longer issue warnings about using ``pytest_plugins`` in non-top-level directories when using ``--pyargs``: the -current ``--pyargs`` mechanism is not reliable and might give false negatives. diff --git a/changelog/4040.bugfix.rst b/changelog/4040.bugfix.rst deleted file mode 100644 index d63541100..000000000 --- a/changelog/4040.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Exclude empty reports for passed tests when ``-rP`` option is used. diff --git a/changelog/4051.bugfix.rst b/changelog/4051.bugfix.rst deleted file mode 100644 index abea99233..000000000 --- a/changelog/4051.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Improve error message when an invalid Python expression is passed to the ``-m`` option. diff --git a/changelog/4056.bugfix.rst b/changelog/4056.bugfix.rst deleted file mode 100644 index f018a4776..000000000 --- a/changelog/4056.bugfix.rst +++ /dev/null @@ -1,4 +0,0 @@ -``MonkeyPatch.setenv`` and ``MonkeyPatch.delenv`` issue a warning if the environment variable name is not ``str`` on Python 2. - -In Python 2, adding ``unicode`` keys to ``os.environ`` causes problems with ``subprocess`` (and possible other modules), -making this a subtle bug specially susceptible when used with ``from __future__ import unicode_literals``. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index cdedd3ca7..e6c712120 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-3.8.2 release-3.8.1 release-3.8.0 release-3.7.4 diff --git a/doc/en/announce/release-3.8.2.rst b/doc/en/announce/release-3.8.2.rst new file mode 100644 index 000000000..124c33aa4 --- /dev/null +++ b/doc/en/announce/release-3.8.2.rst @@ -0,0 +1,28 @@ +pytest-3.8.2 +======================================= + +pytest 3.8.2 has just been released to PyPI. + +This is a bug-fix release, being a drop-in replacement. To upgrade:: + + pip install --upgrade pytest + +The full changelog is available at https://docs.pytest.org/en/latest/changelog.html. + +Thanks to all who contributed to this release, among them: + +* Ankit Goel +* Anthony Sottile +* Bruno Oliveira +* Daniel Hahler +* Denis Otkidach +* Harry Percival +* Jeffrey Rackauckas +* Jose Carlos Menezes +* Ronny Pfannschmidt +* Zac-HD +* iwanb + + +Happy testing, +The pytest Development Team diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst index cb6368a64..a2cb8a676 100644 --- a/doc/en/example/markers.rst +++ b/doc/en/example/markers.rst @@ -31,7 +31,7 @@ You can then restrict a test run to only run tests marked with ``webtest``:: $ pytest -v -m webtest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: $REGENDOC_TMPDIR, inifile: collecting ... collected 4 items / 3 deselected @@ -44,7 +44,7 @@ Or the inverse, running all tests except the webtest ones:: $ pytest -v -m "not webtest" =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: $REGENDOC_TMPDIR, inifile: collecting ... collected 4 items / 1 deselected @@ -64,7 +64,7 @@ tests based on their module, class, method, or function name:: $ pytest -v test_server.py::TestClass::test_method =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: $REGENDOC_TMPDIR, inifile: collecting ... collected 1 item @@ -77,7 +77,7 @@ You can also select on the class:: $ pytest -v test_server.py::TestClass =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: $REGENDOC_TMPDIR, inifile: collecting ... collected 1 item @@ -90,7 +90,7 @@ Or select multiple nodes:: $ pytest -v test_server.py::TestClass test_server.py::test_send_http =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: $REGENDOC_TMPDIR, inifile: collecting ... collected 2 items @@ -128,7 +128,7 @@ select tests based on their names:: $ pytest -v -k http # running with the above defined example module =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: $REGENDOC_TMPDIR, inifile: collecting ... collected 4 items / 3 deselected @@ -141,7 +141,7 @@ And you can also run all tests except the ones that match the keyword:: $ pytest -k "not send_http" -v =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: $REGENDOC_TMPDIR, inifile: collecting ... collected 4 items / 1 deselected @@ -156,7 +156,7 @@ Or to select "http" and "quick" tests:: $ pytest -k "http or quick" -v =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: $REGENDOC_TMPDIR, inifile: collecting ... collected 4 items / 2 deselected diff --git a/doc/en/example/nonpython.rst b/doc/en/example/nonpython.rst index bda15065a..a266b5bfe 100644 --- a/doc/en/example/nonpython.rst +++ b/doc/en/example/nonpython.rst @@ -59,7 +59,7 @@ consulted when reporting in ``verbose`` mode:: nonpython $ pytest -v =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: $REGENDOC_TMPDIR/nonpython, inifile: collecting ... collected 2 items diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index 5af269bba..7dca5510a 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -411,11 +411,10 @@ is to be run with different sets of arguments for its three arguments: Running it results in some skips if we don't have all the python interpreters installed and otherwise runs all combinations (5 interpreters times 5 interpreters times 3 objects to serialize/deserialize):: . $ pytest -rs -q multipython.py - ...ssssssssssssssssssssssss [100%] + ...sss...sssssssss...sss... [100%] ========================= short test summary info ========================== - SKIP [12] $REGENDOC_TMPDIR/CWD/multipython.py:29: 'python3.4' not found - SKIP [12] $REGENDOC_TMPDIR/CWD/multipython.py:29: 'python3.5' not found - 3 passed, 24 skipped in 0.12 seconds + SKIP [15] $REGENDOC_TMPDIR/CWD/multipython.py:29: 'python3.4' not found + 12 passed, 15 skipped in 0.12 seconds Indirect parametrization of optional implementations/imports -------------------------------------------------------------------- diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index c6e6c428e..8c3975c60 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -357,7 +357,7 @@ which will add info only when run with "--v":: $ pytest -v =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache info1: did you know that ... did you? diff --git a/doc/en/fixture.rst b/doc/en/fixture.rst index e48e055fe..d90850d09 100644 --- a/doc/en/fixture.rst +++ b/doc/en/fixture.rst @@ -727,7 +727,7 @@ Running this test will *skip* the invocation of ``data_set`` with value ``2``:: $ pytest test_fixture_marks.py -v =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: $REGENDOC_TMPDIR, inifile: collecting ... collected 3 items @@ -770,7 +770,7 @@ Here we declare an ``app`` fixture which receives the previously defined $ pytest -v test_appsetup.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: $REGENDOC_TMPDIR, inifile: collecting ... collected 2 items @@ -839,7 +839,7 @@ Let's run the tests in verbose mode and with looking at the print-output:: $ pytest -v -s test_module.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: $REGENDOC_TMPDIR, inifile: collecting ... collected 8 items