From 1f2062661826efb5ac4322c17e24db202bf0a147 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 5 Sep 2018 21:06:32 +0000 Subject: [PATCH] Preparing release version 3.8.0 --- CHANGELOG.rst | 84 +++++++++++++++++++++++++++++++ changelog/2452.feature.rst | 5 -- changelog/2452.removal.rst | 12 ----- changelog/2908.feature.rst | 5 -- changelog/3566.doc.rst | 1 - changelog/3784.feature.rst | 1 - changelog/3829.feature.rst | 1 - changelog/3837.feature.rst | 1 - changelog/3853.trivial.rst | 1 - changelog/3907.doc.rst | 1 - changelog/3911.bugfix.rst | 1 - changelog/3913.bugfix.rst | 1 - changelog/3918.bugfix.rst | 1 - changelog/3936.removal.rst | 5 -- doc/en/announce/index.rst | 1 + doc/en/announce/release-3.8.0.rst | 38 ++++++++++++++ doc/en/example/reportingdemo.rst | 6 +-- doc/en/usage.rst | 19 +++---- doc/en/warnings.rst | 17 +++---- doc/en/writing_plugins.rst | 5 +- 20 files changed, 145 insertions(+), 61 deletions(-) delete mode 100644 changelog/2452.feature.rst delete mode 100644 changelog/2452.removal.rst delete mode 100644 changelog/2908.feature.rst delete mode 100644 changelog/3566.doc.rst delete mode 100644 changelog/3784.feature.rst delete mode 100644 changelog/3829.feature.rst delete mode 100644 changelog/3837.feature.rst delete mode 100644 changelog/3853.trivial.rst delete mode 100644 changelog/3907.doc.rst delete mode 100644 changelog/3911.bugfix.rst delete mode 100644 changelog/3913.bugfix.rst delete mode 100644 changelog/3918.bugfix.rst delete mode 100644 changelog/3936.removal.rst create mode 100644 doc/en/announce/release-3.8.0.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 78f2156e803..7a0de069c56 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -18,6 +18,90 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 3.8.0 (2018-09-05) +========================= + +Deprecations and Removals +------------------------- + +- `#2452 `_: ``Config.warn`` has been deprecated, it should be replaced by calls to the standard ``warnings.warn``. + + ``Node.warn`` now supports two signatures: + + * ``node.warn(PytestWarning("some message"))``: is now the recommended way to call this function. The warning + instance must be a ``PytestWarning`` or subclass instance. + + * ``node.warn("CI", "some message")``: this code/message form is now deprecated and should be converted to + the warning instance form above. + + ``RemovedInPytest4Warning`` and ``PytestExperimentalApiWarning`` are now part of the public API and should be accessed + using ``pytest.RemovedInPytest4Warning`` and ``pytest.PytestExperimentalApiWarning``. + + +- `#3936 `_: ``@pytest.mark.filterwarnings`` second parameter is no longer regex-escaped, + making it possible to actually use regular expressions to check the warning message. + + **Note**: regex-escaping the match string was an implementation oversight that might break test suites which depend + on the old behavior. + + + +Features +-------- + +- `#2452 `_: Internal pytest warnings are now issued using the standard ``warnings`` module, making it possible to use + the standard warnings filters to manage those warnings. This introduces ``PytestWarning``, + ``PytestDeprecationWarning`` and ``RemovedInPytest4Warning`` warning types as part of the public API. + + Consult `the documentation `_ for more info. + + +- `#2908 `_: ``DeprecationWarning`` and ``PendingDeprecationWarning`` are now shown by default if no other warning filter is + configured. This makes pytest more compliant with + `PEP-0506 `_. See + `the docs `_ for + more info. + + +- `#3784 `_: Add option to disable plugin auto-loading. + + +- `#3829 `_: Added the ``count`` option to ``console_output_style`` to enable displaying the progress as a count instead of a percentage. + + +- `#3837 `_: Added support for 'xfailed' and 'xpassed' outcomes to the ``pytester.RunResult.assert_outcomes`` signature. + + + +Bug Fixes +--------- + +- `#3911 `_: Terminal writer now takes into account unicode character width when writing out progress. + + +- `#3913 `_: Pytest now returns with correct exit code (EXIT_USAGEERROR, 4) when called with unknown arguments. + + +- `#3918 `_: Improve performance of assertion rewriting. + + + +Improved Documentation +---------------------- + +- `#3566 `_: Added a blurb in usage.rst for the usage of -r flag which is used to show an extra test summary info. + + +- `#3907 `_: Corrected type of the exceptions collection passed to ``xfail``: ``raises`` argument accepts a ``tuple`` instead of ``list``. + + + +Trivial/Internal Changes +------------------------ + +- `#3853 `_: Removed ``"run all (no recorded failures)"`` message printed with ``--failed-first`` and ``--last-failed`` when there are no failed tests. + + pytest 3.7.4 (2018-08-29) ========================= diff --git a/changelog/2452.feature.rst b/changelog/2452.feature.rst deleted file mode 100644 index 847e9540f72..00000000000 --- a/changelog/2452.feature.rst +++ /dev/null @@ -1,5 +0,0 @@ -Internal pytest warnings are now issued using the standard ``warnings`` module, making it possible to use -the standard warnings filters to manage those warnings. This introduces ``PytestWarning``, -``PytestDeprecationWarning`` and ``RemovedInPytest4Warning`` warning types as part of the public API. - -Consult `the documentation `_ for more info. diff --git a/changelog/2452.removal.rst b/changelog/2452.removal.rst deleted file mode 100644 index c2a02830389..00000000000 --- a/changelog/2452.removal.rst +++ /dev/null @@ -1,12 +0,0 @@ -``Config.warn`` has been deprecated, it should be replaced by calls to the standard ``warnings.warn``. - -``Node.warn`` now supports two signatures: - -* ``node.warn(PytestWarning("some message"))``: is now the recommended way to call this function. The warning - instance must be a ``PytestWarning`` or subclass instance. - -* ``node.warn("CI", "some message")``: this code/message form is now deprecated and should be converted to - the warning instance form above. - -``RemovedInPytest4Warning`` and ``PytestExperimentalApiWarning`` are now part of the public API and should be accessed -using ``pytest.RemovedInPytest4Warning`` and ``pytest.PytestExperimentalApiWarning``. diff --git a/changelog/2908.feature.rst b/changelog/2908.feature.rst deleted file mode 100644 index e904a98de82..00000000000 --- a/changelog/2908.feature.rst +++ /dev/null @@ -1,5 +0,0 @@ -``DeprecationWarning`` and ``PendingDeprecationWarning`` are now shown by default if no other warning filter is -configured. This makes pytest more compliant with -`PEP-0506 `_. See -`the docs `_ for -more info. diff --git a/changelog/3566.doc.rst b/changelog/3566.doc.rst deleted file mode 100644 index d8eda4241c6..00000000000 --- a/changelog/3566.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Added a blurb in usage.rst for the usage of -r flag which is used to show an extra test summary info. diff --git a/changelog/3784.feature.rst b/changelog/3784.feature.rst deleted file mode 100644 index 87b6cafb6a1..00000000000 --- a/changelog/3784.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Add option to disable plugin auto-loading. diff --git a/changelog/3829.feature.rst b/changelog/3829.feature.rst deleted file mode 100644 index d3bfdb8e67e..00000000000 --- a/changelog/3829.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Added the ``count`` option to ``console_output_style`` to enable displaying the progress as a count instead of a percentage. diff --git a/changelog/3837.feature.rst b/changelog/3837.feature.rst deleted file mode 100644 index 707c3b0da30..00000000000 --- a/changelog/3837.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Added support for 'xfailed' and 'xpassed' outcomes to the ``pytester.RunResult.assert_outcomes`` signature. diff --git a/changelog/3853.trivial.rst b/changelog/3853.trivial.rst deleted file mode 100644 index 252d4604349..00000000000 --- a/changelog/3853.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Removed ``"run all (no recorded failures)"`` message printed with ``--failed-first`` and ``--last-failed`` when there are no failed tests. diff --git a/changelog/3907.doc.rst b/changelog/3907.doc.rst deleted file mode 100644 index c556344f4b7..00000000000 --- a/changelog/3907.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Corrected type of the exceptions collection passed to ``xfail``: ``raises`` argument accepts a ``tuple`` instead of ``list``. diff --git a/changelog/3911.bugfix.rst b/changelog/3911.bugfix.rst deleted file mode 100644 index 8839fe7d9d8..00000000000 --- a/changelog/3911.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Terminal writer now takes into account unicode character width when writing out progress. diff --git a/changelog/3913.bugfix.rst b/changelog/3913.bugfix.rst deleted file mode 100644 index 33ed4ce28f0..00000000000 --- a/changelog/3913.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Pytest now returns with correct exit code (EXIT_USAGEERROR, 4) when called with unknown arguments. diff --git a/changelog/3918.bugfix.rst b/changelog/3918.bugfix.rst deleted file mode 100644 index 7ba81191616..00000000000 --- a/changelog/3918.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Improve performance of assertion rewriting. diff --git a/changelog/3936.removal.rst b/changelog/3936.removal.rst deleted file mode 100644 index bf0ba0897b1..00000000000 --- a/changelog/3936.removal.rst +++ /dev/null @@ -1,5 +0,0 @@ -``@pytest.mark.filterwarnings`` second parameter is no longer regex-escaped, -making it possible to actually use regular expressions to check the warning message. - -**Note**: regex-escaping the match string was an implementation oversight that might break test suites which depend -on the old behavior. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index f4814ac7d1a..1eaae502a17 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-3.8.0 release-3.7.4 release-3.7.3 release-3.7.2 diff --git a/doc/en/announce/release-3.8.0.rst b/doc/en/announce/release-3.8.0.rst new file mode 100644 index 00000000000..1fc344ea23e --- /dev/null +++ b/doc/en/announce/release-3.8.0.rst @@ -0,0 +1,38 @@ +pytest-3.8.0 +======================================= + +The pytest team is proud to announce the 3.8.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: + +* Anthony Sottile +* Bruno Oliveira +* CrazyMerlyn +* Daniel Hahler +* Fabio Zadrozny +* Jeffrey Rackauckas +* Ronny Pfannschmidt +* Virgil Dupras +* dhirensr +* hoefling +* wim glenn + + +Happy testing, +The Pytest Development Team diff --git a/doc/en/example/reportingdemo.rst b/doc/en/example/reportingdemo.rst index 61891eebd8b..a411aa49a97 100644 --- a/doc/en/example/reportingdemo.rst +++ b/doc/en/example/reportingdemo.rst @@ -613,9 +613,9 @@ get on the terminal - we are working on that):: failure_demo.py:261: AssertionError ============================= warnings summary ============================= - - Metafunc.addcall is deprecated and scheduled to be removed in pytest 4.0. - Please use Metafunc.parametrize instead. + $REGENDOC_TMPDIR/assertion/failure_demo.py:24: RemovedInPytest4Warning: Metafunc.addcall is deprecated and scheduled to be removed in pytest 4.0. + Please use Metafunc.parametrize instead. + metafunc.addcall(funcargs=dict(param1=3, param2=6)) -- Docs: https://docs.pytest.org/en/latest/warnings.html ================== 42 failed, 1 warnings in 0.12 seconds =================== diff --git a/doc/en/usage.rst b/doc/en/usage.rst index f1f0c079e7b..4da7861017a 100644 --- a/doc/en/usage.rst +++ b/doc/en/usage.rst @@ -153,15 +153,12 @@ making it easy in large test suites to get a clear picture of all failures, skip Example:: $ pytest -ra - ======================== test session starts ======================== - ... - ====================== short test summary info ====================== - FAIL summary\test_foo.py::test_1 - SKIP [1] summary\test_foo.py:12: not supported in this platform - XPASS summary\test_bar.py::test_4 flaky - - ===== 1 failed, 1 passed, 1 skipped, 1 xpassed in 0.08 seconds ====== + =========================== test session starts ============================ + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y + rootdir: $REGENDOC_TMPDIR, inifile: + collected 0 items + ======================= no tests ran in 0.12 seconds ======================= The ``-r`` options accepts a number of characters after it, with ``a`` used above meaning "all except passes". @@ -179,8 +176,12 @@ Here is the full list of available characters that can be used: More than one character can be used, so for example to only see failed and skipped tests, you can execute:: $ pytest -rfs + =========================== test session starts ============================ + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y + rootdir: $REGENDOC_TMPDIR, inifile: + collected 0 items - + ======================= no tests ran in 0.12 seconds ======================= .. _pdb-option: diff --git a/doc/en/warnings.rst b/doc/en/warnings.rst index a460ac121a4..1f0c3bf97a6 100644 --- a/doc/en/warnings.rst +++ b/doc/en/warnings.rst @@ -29,9 +29,8 @@ Running pytest now produces this output:: test_show_warnings.py . [100%] ============================= warnings summary ============================= - test_show_warnings.py::test_one - $REGENDOC_TMPDIR/test_show_warnings.py:4: UserWarning: api v1, should use functions from v2 - warnings.warn(UserWarning("api v1, should use functions from v2")) + $REGENDOC_TMPDIR/test_show_warnings.py:4: UserWarning: api v1, should use functions from v2 + warnings.warn(UserWarning("api v1, should use functions from v2")) -- Docs: https://docs.pytest.org/en/latest/warnings.html =================== 1 passed, 1 warnings in 0.12 seconds =================== @@ -354,15 +353,13 @@ defines an ``__init__`` constructor, as this prevents the class from being insta :: $ pytest test_pytest_warnings.py -q - ======================================== warnings summary ========================================= - test_pytest_warnings.py:1 - $REGENDOC_TMPDIR/test_pytest_warnings.py:1: PytestWarning: cannot collect test class 'Test' because it has a __init__ constructor - class Test: - - -- Docs: http://doc.pytest.org/en/latest/warnings.html - 1 warnings in 0.01 seconds + ============================= warnings summary ============================= + $REGENDOC_TMPDIR/test_pytest_warnings.py:1: PytestWarning: cannot collect test class 'Test' because it has a __init__ constructor + class Test: + -- Docs: https://docs.pytest.org/en/latest/warnings.html + 1 warnings in 0.12 seconds These warnings might be filtered using the same builtin mechanisms used to filter other types of warnings. diff --git a/doc/en/writing_plugins.rst b/doc/en/writing_plugins.rst index 03bad31be40..70e48f81791 100644 --- a/doc/en/writing_plugins.rst +++ b/doc/en/writing_plugins.rst @@ -418,9 +418,8 @@ additionally it is possible to copy examples for a example folder before running test_example.py .. [100%] ============================= warnings summary ============================= - test_example.py::test_plugin - $REGENDOC_TMPDIR/test_example.py:4: PytestExperimentalApiWarning: testdir.copy_example is an experimental api that may change over time - testdir.copy_example("test_example.py") + $REGENDOC_TMPDIR/test_example.py:4: PytestExperimentalApiWarning: testdir.copy_example is an experimental api that may change over time + testdir.copy_example("test_example.py") -- Docs: https://docs.pytest.org/en/latest/warnings.html =================== 2 passed, 1 warnings in 0.12 seconds ===================