diff --git a/AUTHORS b/AUTHORS index f979fee0683..5c3610e699c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -107,6 +107,7 @@ Eli Boyarski Elizaveta Shashkova Endre Galaczi Eric Hunsberger +Eric Liu Eric Siegerman Erik Aronesty Erik M. Bray diff --git a/changelog/7469.deprecation.rst b/changelog/7469.deprecation.rst index 3762306c736..423b1633ba8 100644 --- a/changelog/7469.deprecation.rst +++ b/changelog/7469.deprecation.rst @@ -9,4 +9,4 @@ Directly constructing the following classes is now deprecated: - ``_pytest.config.argparsing.Parser`` - ``_pytest.config.argparsing.OptionGroup`` -These have always been considered private, but now issue a deprecation warning, which may become a hard error in pytest 7.0.0. +These have always been considered private, but now issue a deprecation warning, which may become a hard error in pytest 8.0.0. diff --git a/changelog/7469.feature.rst b/changelog/7469.feature.rst index 9922631fee9..3013170870a 100644 --- a/changelog/7469.feature.rst +++ b/changelog/7469.feature.rst @@ -14,6 +14,6 @@ The newly-exported types are: - ``pytest.OptionGroup`` for the :class:`OptionGroup ` type returned from the :func:`parser.addgroup ` method. Constructing them directly is not supported; they are only meant for use in type annotations. -Doing so will emit a deprecation warning, and may become a hard-error in pytest 7.0. +Doing so will emit a deprecation warning, and may become a hard-error in pytest 8.0. Subclassing them is also not supported. This is not currently enforced at runtime, but is detected by type-checkers such as mypy. diff --git a/changelog/8242.deprecation.rst b/changelog/8242.deprecation.rst index b2e8566eaa9..3875c5867e3 100644 --- a/changelog/8242.deprecation.rst +++ b/changelog/8242.deprecation.rst @@ -1,7 +1,7 @@ Raising :class:`unittest.SkipTest` to skip collection of tests during the pytest collection phase is deprecated. Use :func:`pytest.skip` instead. -Note: This deprecation only relates to using `unittest.SkipTest` during test +Note: This deprecation only relates to using :class:`unittest.SkipTest` during test collection. You are probably not doing that. Ordinary usage of :class:`unittest.SkipTest` / :meth:`unittest.TestCase.skipTest` / :func:`unittest.skip` in unittest test cases is fully supported. diff --git a/changelog/8248.trivial.rst b/changelog/8248.trivial.rst index 0a9319d9cd5..3044071fa81 100644 --- a/changelog/8248.trivial.rst +++ b/changelog/8248.trivial.rst @@ -1 +1 @@ -Internal Restructure: let python.PyObjMixing inherit from nodes.Node to carry over typing information. +Internal Restructure: let ``python.PyObjMixin`` inherit from ``nodes.Node`` to carry over typing information. diff --git a/changelog/8315.deprecation.rst b/changelog/8315.deprecation.rst index c30dcf5d13e..b204dcedd9b 100644 --- a/changelog/8315.deprecation.rst +++ b/changelog/8315.deprecation.rst @@ -1,5 +1,5 @@ Several behaviors of :meth:`Parser.addoption ` are now -scheduled for removal in pytest 7 (deprecated since pytest 2.4.0): +scheduled for removal in pytest 8 (deprecated since pytest 2.4.0): - ``parser.addoption(..., help=".. %default ..")`` - use ``%(default)s`` instead. - ``parser.addoption(..., type="int/string/float/complex")`` - use ``type=int`` etc. instead. diff --git a/changelog/8411.trivial.rst b/changelog/8411.trivial.rst deleted file mode 100644 index 8f169a900fa..00000000000 --- a/changelog/8411.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Assert the outcomes for the issue 518 test and fix the test. diff --git a/changelog/8447.deprecation.rst b/changelog/8447.deprecation.rst index d1011f8c849..0116483a3bb 100644 --- a/changelog/8447.deprecation.rst +++ b/changelog/8447.deprecation.rst @@ -1,4 +1,4 @@ -Defining a custom pytest node type which is both an item and a collector now issues a warning. +Defining a custom pytest node type which is both an :class:`pytest.Item ` and a :class:`pytest.Collector ` now issues a warning. It was never sanely supported and triggers hard to debug errors. Instead, a separate collector node should be used, which collects the item. See :ref:`non-python tests` for an example. diff --git a/changelog/8503.trivial.rst b/changelog/8503.bugfix.rst similarity index 100% rename from changelog/8503.trivial.rst rename to changelog/8503.bugfix.rst diff --git a/changelog/8509.improvement.rst b/changelog/8509.improvement.rst index d72e8e487f6..982888c1fea 100644 --- a/changelog/8509.improvement.rst +++ b/changelog/8509.improvement.rst @@ -1,5 +1,5 @@ -Fixed issue where `TestCase.setUpClass` is not called when a test has `/` in its name since pytest 6.2.0. +Fixed issue where :meth:`unittest.TestCase.setUpClass` is not called when a test has `/` in its name since pytest 6.2.0. -This refers to the path part in pytest node IDs, e.g. `TestClass::test_it` in the node ID `tests/test_file.py::TestClass::test_it`. +This refers to the path part in pytest node IDs, e.g. ``TestClass::test_it`` in the node ID ``tests/test_file.py::TestClass::test_it``. Now, instead of assuming that the test name does not contain ``/``, it is assumed that test path does not contain ``::``. We plan to hopefully make both of these work in the future. diff --git a/changelog/8606.feature.rst b/changelog/8606.feature.rst index 9705ffe75d6..d918ecd1ec1 100644 --- a/changelog/8606.feature.rst +++ b/changelog/8606.feature.rst @@ -1,4 +1,4 @@ -pytest invocations with ``--fixtures-per-test`` and ``--fixtures`` have been enabled with: +pytest invocations with ``--fixtures-per-test`` and ``--fixtures`` have been enriched with: - Fixture location path printed with the fixture name. - First section of the fixture's docstring printed under the fixture name. diff --git a/changelog/8645.deprecation.rst b/changelog/8645.deprecation.rst new file mode 100644 index 00000000000..722a5d764de --- /dev/null +++ b/changelog/8645.deprecation.rst @@ -0,0 +1,4 @@ +:func:`pytest.warns(None) ` is now deprecated because many people used +it to mean "this code does not emit warnings", but it actually had the effect of +checking that the code emits at least one warning of any type - like ``pytest.warns()`` +or ``pytest.warns(Warning)``. diff --git a/changelog/8645.improvement.rst b/changelog/8645.improvement.rst deleted file mode 100644 index b3a68b0b8c8..00000000000 --- a/changelog/8645.improvement.rst +++ /dev/null @@ -1,4 +0,0 @@ -Reducing confusion from `pytest.warns(None)` by: - -- Allowing no arguments to be passed in order to catch any exception (no argument defaults to `Warning`). -- Emit a deprecation warning if passed `None`.