diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a6aa836df..31d14ebe3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,70 @@ .. towncrier release notes start +pytest 3.7.0 (2018-07-30) +========================= + +Deprecations and Removals +------------------------- + +- `#2639 `_: ``pytest_namespace`` has been deprecated. + + See the documentation for ``pytest_namespace`` hook for suggestions on how to deal + with this in plugins which use this functionality. + + +- `#3661 `_: Calling a fixture function directly, as opposed to request them in a test function, now issues a ``RemovedInPytest4Warning``. It will be changed into an error in pytest ``4.0``. + + This is a great source of confusion to new users, which will often call the fixture functions and request them from test functions interchangeably, which breaks the fixture resolution model. + + + +Features +-------- + +- `#2283 `_: New ``package`` fixture scope: fixtures are finalized when the last test of a *package* finishes. This feature is considered **experimental**, so use it sparingly. + + +- `#3576 `_: ``Node.add_marker`` now supports an ``append=True/False`` parameter to determine whether the mark comes last (default) or first. + + +- `#3579 `_: Fixture ``caplog`` now has a ``messages`` property, providing convenient access to the format-interpolated log messages without the extra data provided by the formatter/handler. + + +- `#3610 `_: New ``--trace`` option to enter the debugger at the start of a test. + + +- `#3623 `_: Introduce ``pytester.copy_example`` as helper to do acceptance tests against examples from the project. + + + +Bug Fixes +--------- + +- `#2220 `_: Fix a bug where fixtures overriden by direct parameters (for example parametrization) were being instantiated even if they were not being used by a test. + + +- `#3695 `_: Fix ``ApproxNumpy`` initialisation argument mixup, ``abs`` and ``rel`` tolerances were flipped causing strange comparsion results. + Add tests to check ``abs`` and ``rel`` tolerances for ``np.array`` and test for expecting ``nan`` with ``np.array()`` + + +- `#980 `_: Fix truncated locals output in verbose mode. + + + +Improved Documentation +---------------------- + +- `#3295 `_: Correct the usage documentation of ``--last-failed-no-failures`` by adding the missing ``--last-failed`` argument in the presented examples, for they are missleading and lead to think that the missing argument is not needed. + + + +Trivial/Internal Changes +------------------------ + +- `#3519 `_: Now a ``README.md`` file is created in ``.pytest_cache`` to make it clear why the directory exists. + + pytest 3.6.4 (2018-07-28) ========================= diff --git a/changelog/2220.bugfix.rst b/changelog/2220.bugfix.rst deleted file mode 100644 index e15101131..000000000 --- a/changelog/2220.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix a bug where fixtures overriden by direct parameters (for example parametrization) were being instantiated even if they were not being used by a test. diff --git a/changelog/2283.feature b/changelog/2283.feature deleted file mode 100644 index 9a8f2c4c9..000000000 --- a/changelog/2283.feature +++ /dev/null @@ -1 +0,0 @@ -New ``package`` fixture scope: fixtures are finalized when the last test of a *package* finishes. This feature is considered **experimental**, so use it sparingly. diff --git a/changelog/2639.removal.rst b/changelog/2639.removal.rst deleted file mode 100644 index 3ae6aa4db..000000000 --- a/changelog/2639.removal.rst +++ /dev/null @@ -1,4 +0,0 @@ -``pytest_namespace`` has been deprecated. - -See the documentation for ``pytest_namespace`` hook for suggestions on how to deal -with this in plugins which use this functionality. diff --git a/changelog/3295.doc.rst b/changelog/3295.doc.rst deleted file mode 100644 index c4e351efb..000000000 --- a/changelog/3295.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Correct the usage documentation of ``--last-failed-no-failures`` by adding the missing ``--last-failed`` argument in the presented examples, for they are missleading and lead to think that the missing argument is not needed. diff --git a/changelog/3519.trivial.rst b/changelog/3519.trivial.rst deleted file mode 100644 index a36c4b492..000000000 --- a/changelog/3519.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Now a ``README.md`` file is created in ``.pytest_cache`` to make it clear why the directory exists. diff --git a/changelog/3576.feature.rst b/changelog/3576.feature.rst deleted file mode 100644 index 6763a00e6..000000000 --- a/changelog/3576.feature.rst +++ /dev/null @@ -1 +0,0 @@ -``Node.add_marker`` now supports an ``append=True/False`` parameter to determine whether the mark comes last (default) or first. diff --git a/changelog/3579.feature.rst b/changelog/3579.feature.rst deleted file mode 100644 index 575af006f..000000000 --- a/changelog/3579.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Fixture ``caplog`` now has a ``messages`` property, providing convenient access to the format-interpolated log messages without the extra data provided by the formatter/handler. diff --git a/changelog/3610.feature.rst b/changelog/3610.feature.rst deleted file mode 100644 index a98295ce8..000000000 --- a/changelog/3610.feature.rst +++ /dev/null @@ -1 +0,0 @@ -New ``--trace`` option to enter the debugger at the start of a test. diff --git a/changelog/3623.feature.rst b/changelog/3623.feature.rst deleted file mode 100644 index 589d858b9..000000000 --- a/changelog/3623.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Introduce ``pytester.copy_example`` as helper to do acceptance tests against examples from the project. diff --git a/changelog/3661.removal.rst b/changelog/3661.removal.rst deleted file mode 100644 index baa30fccf..000000000 --- a/changelog/3661.removal.rst +++ /dev/null @@ -1,3 +0,0 @@ -Calling a fixture function directly, as opposed to request them in a test function, now issues a ``RemovedInPytest4Warning``. It will be changed into an error in pytest ``4.0``. - -This is a great source of confusion to new users, which will often call the fixture functions and request them from test functions interchangeably, which breaks the fixture resolution model. diff --git a/changelog/3695.bugfix.rst b/changelog/3695.bugfix.rst deleted file mode 100644 index 42d07336b..000000000 --- a/changelog/3695.bugfix.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix ``ApproxNumpy`` initialisation argument mixup, ``abs`` and ``rel`` tolerances were flipped causing strange comparsion results. -Add tests to check ``abs`` and ``rel`` tolerances for ``np.array`` and test for expecting ``nan`` with ``np.array()`` diff --git a/changelog/980.bugfix.rst b/changelog/980.bugfix.rst deleted file mode 100644 index e30c38f20..000000000 --- a/changelog/980.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix truncated locals output in verbose mode. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index 42c3e4d61..a9e40571d 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-3.7.0 release-3.6.4 release-3.6.3 release-3.6.2 diff --git a/doc/en/announce/release-3.7.0.rst b/doc/en/announce/release-3.7.0.rst new file mode 100644 index 000000000..922b22517 --- /dev/null +++ b/doc/en/announce/release-3.7.0.rst @@ -0,0 +1,41 @@ +pytest-3.7.0 +======================================= + +The pytest team is proud to announce the 3.7.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: + + 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: + +* Alan +* Alan Brammer +* Ammar Najjar +* Anthony Sottile +* Bruno Oliveira +* Jeffrey Rackauckas +* Kale Kundert +* Ronny Pfannschmidt +* Serhii Mozghovyi +* Tadek Teleżyński +* Wil Cooley +* abrammer +* avirlrma +* turturica + + +Happy testing, +The Pytest Development Team diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst index 1b4aa9279..93dc37197 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.5 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 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.5 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 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.5 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 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.5 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 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.5 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 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.5 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 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.5 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 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.5 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 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 4f5adf63f..bda15065a 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.5 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache rootdir: $REGENDOC_TMPDIR/nonpython, inifile: collecting ... collected 2 items @@ -84,8 +84,9 @@ interesting to just look at the collection tree:: platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y rootdir: $REGENDOC_TMPDIR/nonpython, inifile: collected 2 items - - - + + + + ======================= no tests ran in 0.12 seconds ======================= diff --git a/doc/en/example/reportingdemo.rst b/doc/en/example/reportingdemo.rst index a7cc81694..c54b9d040 100644 --- a/doc/en/example/reportingdemo.rst +++ b/doc/en/example/reportingdemo.rst @@ -363,7 +363,7 @@ get on the terminal - we are working on that):: > int(s) E ValueError: invalid literal for int() with base 10: 'qwe' - <0-codegen $PYTHON_PREFIX/lib/python3.5/site-packages/_pytest/python_api.py:635>:1: ValueError + <0-codegen $PYTHON_PREFIX/lib/python3.6/site-packages/_pytest/python_api.py:635>:1: ValueError ______________________ TestRaises.test_raises_doesnt _______________________ self = diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index 180637ae9..c6e6c428e 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.5 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache info1: did you know that ... did you? diff --git a/doc/en/fixture.rst b/doc/en/fixture.rst index d7a343f61..8ea13c7f4 100644 --- a/doc/en/fixture.rst +++ b/doc/en/fixture.rst @@ -726,7 +726,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.5 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache rootdir: $REGENDOC_TMPDIR, inifile: collecting ... collected 3 items @@ -769,7 +769,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.5 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache rootdir: $REGENDOC_TMPDIR, inifile: collecting ... collected 2 items @@ -838,7 +838,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.5 + platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y -- $PYTHON_PREFIX/bin/python3.6 cachedir: .pytest_cache rootdir: $REGENDOC_TMPDIR, inifile: collecting ... collected 8 items diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index f2dbec5e9..5393195d8 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -27,7 +27,7 @@ Install ``pytest`` 2. Check that you installed the correct version:: $ pytest --version - This is pytest version 3.x.y, imported from $PYTHON_PREFIX/lib/python3.5/site-packages/pytest.py + This is pytest version 3.x.y, imported from $PYTHON_PREFIX/lib/python3.6/site-packages/pytest.py .. _`simpletest`: