diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4146670f2..fe3ff47e2 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,181 @@ .. towncrier release notes start +Pytest 3.3.0 (2017-11-23) +========================= + +Deprecations and Removals +------------------------- + +- - Remove internal ``_preloadplugins()`` function. This removal is part of the + ``pytest_namespace()`` hook deprecation. (`#2236 + `_) + +- Internally change ``CallSpec2`` to have a list of marks instead of a broken + mapping of keywords. This removes the keywords attribute of the internal + ``CallSpec2`` class. (`#2672 + `_) + +- remove ParameterSet.deprecated_arg_dict - its not a public api and the lack + of the underscore was a naming error. (`#2675 + `_) + +- Remove the internal multi-typed attribute ``Node._evalskip`` and replace it + with the boolean ``Node._skipped_by_mark``. (`#2767 + `_) + +- ``TerminalReporter._tw`` has been deprecated in favor of + ``TerminalReporter.writer`` and will be removed in a future version. Also, + ``TerminalReporter.writer`` is now read-only. (`#2803 + `_) + +- Pytest no longer supports Python **2.6** and **3.3**. Those Python versions + are EOL for some time now and incurr maintanance and compatibility costs on + the pytest core team, and following up with the rest of the community we + decided that they will no longer be supported starting on this version. Users + which still require those versions should pin pytest to ``<3.3``. (`#2812 + `_) + + +Features +-------- + +- ``pytest_fixture_post_finalizer`` hook can now receive a ``request`` + argument. (`#2124 `_) + +- Replace the old introspection code in compat.py that determines the available + arguments of fixtures with inspect.signature on Python 3 and + funcsigs.signature on Python 2. This should respect __signature__ + declarations on functions. (`#2267 + `_) + +- Report only once tests with global ``pytestmark`` variable. (`#2549 + `_) + +- Now pytest displays the total progress percentage while running tests. The + previous output style can be set by setting the new ``console_output_style`` + to ``classic``. (`#2657 `_) + +- Match ``warns`` signature to ``raises`` by adding ``match`` keyworkd. (`#2708 + `_) + +- Pytest now captures and displays output from the standard `logging` module. + The user can control the logging level to be captured by specifying options + in ``pytest.ini``, the command line and also during individual tests using + markers. Also, a ``caplog`` fixture is available that enables users to test + the captured log during specific tests (similar to ``capsys`` for example). + For more information, please see the `docs + `_. This feature was + introduced by merging the popular `pytest-catchlog + `_ plugin, thanks to `Thomas Hisch + `_. Be advised that during the merging the + backward compatibility interface with the defunct ``pytest-capturelog`` has + been dropped. (`#2794 `_) + +- Add ``allow_module_level`` kwarg to ``pytest.skip()``, enabling to skip the + whole module. (`#2808 `_) + +- Allow setting ``file_or_dir``, ``-c``, and ``-o`` in PYTEST_ADDOPTS. (`#2824 + `_) + +- Return stdout/stderr capture results as a ``namedtuple``, so ``out`` and + ``err`` can be accessed by attribute. (`#2879 + `_) + +- Add ``capfdbinary`` a version of ``capfd`` which returns bytes from + ``readouterr()``. (`#2923 + `_) + +- Add ``capsysbinary`` a version of ``capsys`` which returns bytes from + ``readouterr()``. (`#2934 + `_) + +- Implement feature to skip ``setup.py`` files when ran with + ``--doctest-modules``. (`#502 + `_) + + +Bug Fixes +--------- + +- Resume output capturing after ``capsys/capfd.disabled()`` context manager. + (`#1993 `_) + +- ``pytest_fixture_setup`` and ``pytest_fixture_post_finalizer`` hooks are now + called for all ``conftest.py`` files. (`#2124 + `_) + +- If an exception happens while loading a plugin, pytest no longer hides the + original traceback. In python2 it will show the original traceback with a new + message that explains in which plugin. In python3 it will show 2 canonized + exceptions, the original exception while loading the plugin in addition to an + exception that PyTest throws about loading a plugin. (`#2491 + `_) + +- ``capsys`` and ``capfd`` can now be used by other fixtures. (`#2709 + `_) + +- Internal ``pytester`` plugin properly encodes ``bytes`` arguments to + ``utf-8``. (`#2738 `_) + +- ``testdir`` now uses use the same method used by ``tmpdir`` to create its + temporary directory. This changes the final structure of the ``testdir`` + directory slightly, but should not affect usage in normal scenarios and + avoids a number of potential problems. (`#2751 + `_) + +- Pytest no longer complains about warnings with unicode messages being + non-ascii compatible even for ascii-compatible messages. As a result of this, + warnings with unicode messages are converted first to an ascii representation + for safety. (`#2809 `_) + +- Change return value of pytest command when ``--maxfail`` is reached from + ``2`` (interrupted) to ``1`` (failed). (`#2845 + `_) + +- Fix issue in assertion rewriting which could lead it to rewrite modules which + should not be rewritten. (`#2939 + `_) + +- Handle marks without description in ``pytest.ini``. (`#2942 + `_) + + +Trivial/Internal Changes +------------------------ + +- pytest now depends on `attrs `_ for internal + structures to ease code maintainability. (`#2641 + `_) + +- Refactored internal Python 2/3 compatibility code to use ``six``. (`#2642 + `_) + +- Stop vendoring ``pluggy`` - we're missing out on it's latest changes for not + much benefit (`#2719 `_) + +- Internal refactor: simplify ascii string escaping by using the + backslashreplace error handler in newer Python 3 versions. (`#2734 + `_) + +- * remove unnecessary mark evaluator in unittest plugin (`#2767 + `_) + +- Calls to ``Metafunc.addcall`` now emit a deprecation warning. This function + is scheduled to be removed in ``pytest-4.0``. (`#2876 + `_) + +- Internal move of the parameterset extraction to a more maintainable place. + (`#2877 `_) + +- Internal refactoring to simplify scope node lookup. (`#2910 + `_) + +- Configure ``pytest`` to prevent pip from installing pytest in unsupported + Python versions. (`#2922 + `_) + + Pytest 3.2.5 (2017-11-15) ========================= diff --git a/changelog/1993.bugfix b/changelog/1993.bugfix deleted file mode 100644 index 07a78cc91..000000000 --- a/changelog/1993.bugfix +++ /dev/null @@ -1 +0,0 @@ -Resume output capturing after ``capsys/capfd.disabled()`` context manager. diff --git a/changelog/2124.bugfix b/changelog/2124.bugfix deleted file mode 100644 index e1c5e044c..000000000 --- a/changelog/2124.bugfix +++ /dev/null @@ -1 +0,0 @@ -``pytest_fixture_setup`` and ``pytest_fixture_post_finalizer`` hooks are now called for all ``conftest.py`` files. diff --git a/changelog/2124.feature b/changelog/2124.feature deleted file mode 100644 index 267fdabc9..000000000 --- a/changelog/2124.feature +++ /dev/null @@ -1 +0,0 @@ -``pytest_fixture_post_finalizer`` hook can now receive a ``request`` argument. diff --git a/changelog/2236.removal b/changelog/2236.removal deleted file mode 100644 index 84f98d009..000000000 --- a/changelog/2236.removal +++ /dev/null @@ -1 +0,0 @@ -- Remove internal ``_preloadplugins()`` function. This removal is part of the ``pytest_namespace()`` hook deprecation. \ No newline at end of file diff --git a/changelog/2267.feature b/changelog/2267.feature deleted file mode 100644 index a2f14811e..000000000 --- a/changelog/2267.feature +++ /dev/null @@ -1,4 +0,0 @@ -Replace the old introspection code in compat.py that determines the -available arguments of fixtures with inspect.signature on Python 3 and -funcsigs.signature on Python 2. This should respect __signature__ -declarations on functions. diff --git a/changelog/2491.bugfix b/changelog/2491.bugfix deleted file mode 100644 index fbb16e17e..000000000 --- a/changelog/2491.bugfix +++ /dev/null @@ -1,4 +0,0 @@ -If an exception happens while loading a plugin, pytest no longer hides the original traceback. -In python2 it will show the original traceback with a new message that explains in which plugin. -In python3 it will show 2 canonized exceptions, the original exception while loading the plugin -in addition to an exception that PyTest throws about loading a plugin. diff --git a/changelog/2549.feature b/changelog/2549.feature deleted file mode 100644 index 4866d990d..000000000 --- a/changelog/2549.feature +++ /dev/null @@ -1 +0,0 @@ -Report only once tests with global ``pytestmark`` variable. \ No newline at end of file diff --git a/changelog/2641.trivial b/changelog/2641.trivial deleted file mode 100644 index 1799f90d2..000000000 --- a/changelog/2641.trivial +++ /dev/null @@ -1 +0,0 @@ -pytest now depends on `attrs `_ for internal structures to ease code maintainability. diff --git a/changelog/2642.trivial b/changelog/2642.trivial deleted file mode 100644 index bae449dba..000000000 --- a/changelog/2642.trivial +++ /dev/null @@ -1 +0,0 @@ -Refactored internal Python 2/3 compatibility code to use ``six``. diff --git a/changelog/2657.feature b/changelog/2657.feature deleted file mode 100644 index d0cc3bfd4..000000000 --- a/changelog/2657.feature +++ /dev/null @@ -1 +0,0 @@ -Now pytest displays the total progress percentage while running tests. The previous output style can be set by setting the new ``console_output_style`` to ``classic``. diff --git a/changelog/2672.removal b/changelog/2672.removal deleted file mode 100644 index e660c27fd..000000000 --- a/changelog/2672.removal +++ /dev/null @@ -1,2 +0,0 @@ -Internally change ``CallSpec2`` to have a list of marks instead of a broken mapping of keywords. -This removes the keywords attribute of the internal ``CallSpec2`` class. \ No newline at end of file diff --git a/changelog/2675.removal b/changelog/2675.removal deleted file mode 100644 index 44f597892..000000000 --- a/changelog/2675.removal +++ /dev/null @@ -1 +0,0 @@ -remove ParameterSet.deprecated_arg_dict - its not a public api and the lack of the underscore was a naming error. \ No newline at end of file diff --git a/changelog/2708.feature b/changelog/2708.feature deleted file mode 100644 index f6039ede9..000000000 --- a/changelog/2708.feature +++ /dev/null @@ -1 +0,0 @@ -Match ``warns`` signature to ``raises`` by adding ``match`` keyworkd. \ No newline at end of file diff --git a/changelog/2709.bugfix b/changelog/2709.bugfix deleted file mode 100644 index 88503b050..000000000 --- a/changelog/2709.bugfix +++ /dev/null @@ -1 +0,0 @@ -``capsys`` and ``capfd`` can now be used by other fixtures. diff --git a/changelog/2719.trivial b/changelog/2719.trivial deleted file mode 100644 index 008f1dd20..000000000 --- a/changelog/2719.trivial +++ /dev/null @@ -1 +0,0 @@ -Stop vendoring ``pluggy`` - we're missing out on it's latest changes for not much benefit diff --git a/changelog/2734.trivial b/changelog/2734.trivial deleted file mode 100644 index b3f8471af..000000000 --- a/changelog/2734.trivial +++ /dev/null @@ -1 +0,0 @@ -Internal refactor: simplify ascii string escaping by using the backslashreplace error handler in newer Python 3 versions. diff --git a/changelog/2738.bugfix b/changelog/2738.bugfix deleted file mode 100644 index c53869f49..000000000 --- a/changelog/2738.bugfix +++ /dev/null @@ -1 +0,0 @@ -Internal ``pytester`` plugin properly encodes ``bytes`` arguments to ``utf-8``. diff --git a/changelog/2751.bugfix b/changelog/2751.bugfix deleted file mode 100644 index 76004a653..000000000 --- a/changelog/2751.bugfix +++ /dev/null @@ -1 +0,0 @@ -``testdir`` now uses use the same method used by ``tmpdir`` to create its temporary directory. This changes the final structure of the ``testdir`` directory slightly, but should not affect usage in normal scenarios and avoids a number of potential problems. \ No newline at end of file diff --git a/changelog/2767.removal b/changelog/2767.removal deleted file mode 100644 index b9c3984cd..000000000 --- a/changelog/2767.removal +++ /dev/null @@ -1 +0,0 @@ -Remove the internal multi-typed attribute ``Node._evalskip`` and replace it with the boolean ``Node._skipped_by_mark``. \ No newline at end of file diff --git a/changelog/2767.trivial b/changelog/2767.trivial deleted file mode 100644 index c42a06e07..000000000 --- a/changelog/2767.trivial +++ /dev/null @@ -1 +0,0 @@ -* remove unnecessary mark evaluator in unittest plugin \ No newline at end of file diff --git a/changelog/2794.feature b/changelog/2794.feature deleted file mode 100644 index 9cff1c4bb..000000000 --- a/changelog/2794.feature +++ /dev/null @@ -1,3 +0,0 @@ -Pytest now captures and displays output from the standard `logging` module. The user can control the logging level to be captured by specifying options in ``pytest.ini``, the command line and also during individual tests using markers. Also, a ``caplog`` fixture is available that enables users to test the captured log during specific tests (similar to ``capsys`` for example). For more information, please see the `docs `_. - -This feature was introduced by merging the popular `pytest-catchlog `_ plugin, thanks to `Thomas Hisch `_. Be advised that during the merging the backward compatibility interface with the defunct ``pytest-capturelog`` has been dropped. \ No newline at end of file diff --git a/changelog/2803.removal b/changelog/2803.removal deleted file mode 100644 index 4ebdb903e..000000000 --- a/changelog/2803.removal +++ /dev/null @@ -1 +0,0 @@ -``TerminalReporter._tw`` has been deprecated in favor of ``TerminalReporter.writer`` and will be removed in a future version. Also, ``TerminalReporter.writer`` is now read-only. diff --git a/changelog/2808.feature b/changelog/2808.feature deleted file mode 100644 index 26245f047..000000000 --- a/changelog/2808.feature +++ /dev/null @@ -1 +0,0 @@ -Add ``allow_module_level`` kwarg to ``pytest.skip()``, enabling to skip the whole module. diff --git a/changelog/2809.bugfix b/changelog/2809.bugfix deleted file mode 100644 index 6db7e8c6c..000000000 --- a/changelog/2809.bugfix +++ /dev/null @@ -1 +0,0 @@ -Pytest no longer complains about warnings with unicode messages being non-ascii compatible even for ascii-compatible messages. As a result of this, warnings with unicode messages are converted first to an ascii representation for safety. \ No newline at end of file diff --git a/changelog/2812.removal b/changelog/2812.removal deleted file mode 100644 index 74894e0ef..000000000 --- a/changelog/2812.removal +++ /dev/null @@ -1 +0,0 @@ -Pytest no longer supports Python **2.6** and **3.3**. Those Python versions are EOL for some time now and incurr maintanance and compatibility costs on the pytest core team, and following up with the rest of the community we decided that they will no longer be supported starting on this version. Users which still require those versions should pin pytest to ``<3.3``. diff --git a/changelog/2824.feature b/changelog/2824.feature deleted file mode 100644 index 690ca939a..000000000 --- a/changelog/2824.feature +++ /dev/null @@ -1 +0,0 @@ -Allow setting ``file_or_dir``, ``-c``, and ``-o`` in PYTEST_ADDOPTS. diff --git a/changelog/2845.bugfix b/changelog/2845.bugfix deleted file mode 100644 index c6767631e..000000000 --- a/changelog/2845.bugfix +++ /dev/null @@ -1 +0,0 @@ -Change return value of pytest command when ``--maxfail`` is reached from ``2`` (interrupted) to ``1`` (failed). diff --git a/changelog/2876.trivial b/changelog/2876.trivial deleted file mode 100644 index 354f6ad5c..000000000 --- a/changelog/2876.trivial +++ /dev/null @@ -1 +0,0 @@ -Calls to ``Metafunc.addcall`` now emit a deprecation warning. This function is scheduled to be removed in ``pytest-4.0``. diff --git a/changelog/2877.trivial b/changelog/2877.trivial deleted file mode 100644 index c4198af97..000000000 --- a/changelog/2877.trivial +++ /dev/null @@ -1 +0,0 @@ -Internal move of the parameterset extraction to a more maintainable place. diff --git a/changelog/2879.feature b/changelog/2879.feature deleted file mode 100644 index 8932d8c30..000000000 --- a/changelog/2879.feature +++ /dev/null @@ -1 +0,0 @@ -Return stdout/stderr capture results as a ``namedtuple``, so ``out`` and ``err`` can be accessed by attribute. diff --git a/changelog/2910.trivial b/changelog/2910.trivial deleted file mode 100644 index 87bf00dfe..000000000 --- a/changelog/2910.trivial +++ /dev/null @@ -1 +0,0 @@ -Internal refactoring to simplify scope node lookup. diff --git a/changelog/2922.trivial b/changelog/2922.trivial deleted file mode 100644 index 06d1346bb..000000000 --- a/changelog/2922.trivial +++ /dev/null @@ -1 +0,0 @@ -Configure ``pytest`` to prevent pip from installing pytest in unsupported Python versions. diff --git a/changelog/2923.feature b/changelog/2923.feature deleted file mode 100644 index c6937741f..000000000 --- a/changelog/2923.feature +++ /dev/null @@ -1,2 +0,0 @@ -Add ``capfdbinary`` a version of ``capfd`` which returns bytes from -``readouterr()``. diff --git a/changelog/2934.feature b/changelog/2934.feature deleted file mode 100644 index 38dcb5f73..000000000 --- a/changelog/2934.feature +++ /dev/null @@ -1,2 +0,0 @@ -Add ``capsysbinary`` a version of ``capsys`` which returns bytes from -``readouterr()``. diff --git a/changelog/2939.bugfix b/changelog/2939.bugfix deleted file mode 100644 index 8aeedad01..000000000 --- a/changelog/2939.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix issue in assertion rewriting which could lead it to rewrite modules which should not be rewritten. diff --git a/changelog/2942.bugfix b/changelog/2942.bugfix deleted file mode 100644 index 3223719e2..000000000 --- a/changelog/2942.bugfix +++ /dev/null @@ -1 +0,0 @@ -Handle marks without description in ``pytest.ini``. diff --git a/changelog/502.feature b/changelog/502.feature deleted file mode 100644 index eb61640b9..000000000 --- a/changelog/502.feature +++ /dev/null @@ -1 +0,0 @@ -Implement feature to skip ``setup.py`` files when ran with ``--doctest-modules``. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index d340f5d46..1a5f3760b 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-3.3.0 release-3.2.5 release-3.2.4 release-3.2.3 diff --git a/doc/en/announce/release-3.3.0.rst b/doc/en/announce/release-3.3.0.rst new file mode 100644 index 000000000..e0740e7d5 --- /dev/null +++ b/doc/en/announce/release-3.3.0.rst @@ -0,0 +1,50 @@ +pytest-3.3.0 +======================================= + +The pytest team is proud to announce the 3.3.0 release! + +pytest is a mature Python testing tool with more than a 1600 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: + + http://doc.pytest.org/en/latest/changelog.html + +For complete documentation, please visit: + + http://docs.pytest.org + +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 +* Ceridwen +* Daniel Hahler +* Dirk Thomas +* Dmitry Malinovsky +* Florian Bruhin +* George Y. Kussumoto +* Hugo +* Jesús Espino +* Joan Massich +* Ofir +* OfirOshir +* Ronny Pfannschmidt +* Samuel Dion-Girardeau +* Srinivas Reddy Thatiparthy +* Sviatoslav Abakumov +* Tarcisio Fischer +* Thomas Hisch +* Tyler Goodlet +* hugovk +* je +* prokaktus + + +Happy testing, +The Pytest Development Team diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index 49852ed7b..dd01b2527 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -411,11 +411,8 @@ 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%] - ========================= short test summary info ========================== - SKIP [12] $REGENDOC_TMPDIR/CWD/multipython.py:24: 'python2.7' not found - SKIP [12] $REGENDOC_TMPDIR/CWD/multipython.py:24: 'python3.4' not found - 3 passed, 24 skipped in 0.12 seconds + ........................... [100%] + 27 passed in 0.12 seconds Indirect parametrization of optional implementations/imports --------------------------------------------------------------------