From 268761dd9ab720b59b5aec03b34fba7456cbac20 Mon Sep 17 00:00:00 2001 From: ericluoliu Date: Tue, 29 Jun 2021 14:11:49 -0700 Subject: [PATCH 1/7] fixed changelog/*.rst docs --- changelog/7469.deprecation.rst | 2 +- changelog/7469.feature.rst | 2 +- changelog/8242.deprecation.rst | 2 +- changelog/8248.trivial.rst | 2 +- changelog/8315.deprecation.rst | 2 +- changelog/8447.deprecation.rst | 2 +- changelog/8509.improvement.rst | 4 ++-- changelog/8606.feature.rst | 2 +- changelog/8645.improvement.rst | 6 +++--- changelog/8761.feature.rst | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/changelog/7469.deprecation.rst b/changelog/7469.deprecation.rst index 3762306c736..98acf025b85 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. \ No newline at end of file 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..57b6983ea26 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.PyObjMixing`` inherit from ``nodes.Node`` to carry over typing information. \ No newline at end of file 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/8447.deprecation.rst b/changelog/8447.deprecation.rst index d1011f8c849..7d99654cad0 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/8509.improvement.rst b/changelog/8509.improvement.rst index d72e8e487f6..c1e8b28bcd3 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 :method:`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.improvement.rst b/changelog/8645.improvement.rst index b3a68b0b8c8..ad3e014b516 100644 --- a/changelog/8645.improvement.rst +++ b/changelog/8645.improvement.rst @@ -1,4 +1,4 @@ -Reducing confusion from `pytest.warns(None)` by: +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`. +- Allowing no arguments to be passed in order to catch any exception (no argument defaults to :class:`Warning`). +- Emit a deprecation warning if passed ``None``. diff --git a/changelog/8761.feature.rst b/changelog/8761.feature.rst index 88288c81002..59225849243 100644 --- a/changelog/8761.feature.rst +++ b/changelog/8761.feature.rst @@ -1 +1 @@ -New :ref:`version-tuple` attribute, which makes it simpler for users to do something depending on the pytest version (such as declaring hooks which are introduced in later versions). +New :ref:`version_tuple` attribute, which makes it simpler for users to do something depending on the pytest version (such as declaring hooks which are introduced in later versions). From f0033b88bc7ef7b42ff08dc9541488369f627e52 Mon Sep 17 00:00:00 2001 From: ericluoliu Date: Tue, 29 Jun 2021 14:16:34 -0700 Subject: [PATCH 2/7] add author name --- AUTHORS | 1 + 1 file changed, 1 insertion(+) 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 From d41850e415fd64b47a9621617ffc89cf35eed9cd Mon Sep 17 00:00:00 2001 From: ericluoliu Date: Wed, 30 Jun 2021 06:45:44 -0700 Subject: [PATCH 3/7] fixed-documents --- changelog/8248.trivial.rst | 2 +- changelog/8411.trivial.rst | 1 - changelog/{8503.trivial.rst => 8503.bugfix.rst} | 0 changelog/8509.improvement.rst | 2 +- 4 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 changelog/8411.trivial.rst rename changelog/{8503.trivial.rst => 8503.bugfix.rst} (100%) diff --git a/changelog/8248.trivial.rst b/changelog/8248.trivial.rst index 57b6983ea26..0015e6155cd 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. \ No newline at end of file +Internal Restructure: let ``python.PyObjMixin`` inherit from ``nodes.Node`` to carry over typing information. \ No newline at end of file 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/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 c1e8b28bcd3..982888c1fea 100644 --- a/changelog/8509.improvement.rst +++ b/changelog/8509.improvement.rst @@ -1,4 +1,4 @@ -Fixed issue where :method:`unittest.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``. From 96c787f70b3c8af8561221cddf40eafd4286a2ba Mon Sep 17 00:00:00 2001 From: ericluoliu Date: Thu, 1 Jul 2021 13:35:06 -0700 Subject: [PATCH 4/7] fix issue 8761 doc --- changelog/8761.feature.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/8761.feature.rst b/changelog/8761.feature.rst index 59225849243..88288c81002 100644 --- a/changelog/8761.feature.rst +++ b/changelog/8761.feature.rst @@ -1 +1 @@ -New :ref:`version_tuple` attribute, which makes it simpler for users to do something depending on the pytest version (such as declaring hooks which are introduced in later versions). +New :ref:`version-tuple` attribute, which makes it simpler for users to do something depending on the pytest version (such as declaring hooks which are introduced in later versions). From e38d35aea5c1dc651bd6d0c82ed3711236c4b29b Mon Sep 17 00:00:00 2001 From: ericluoliu Date: Fri, 2 Jul 2021 13:29:42 -0700 Subject: [PATCH 5/7] fix issue 8645 doc --- changelog/8645.deprecation.rst | 4 ++++ changelog/8645.improvement.rst | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 changelog/8645.deprecation.rst delete mode 100644 changelog/8645.improvement.rst diff --git a/changelog/8645.deprecation.rst b/changelog/8645.deprecation.rst new file mode 100644 index 00000000000..15a76ed8966 --- /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)``. \ No newline at end of file diff --git a/changelog/8645.improvement.rst b/changelog/8645.improvement.rst deleted file mode 100644 index ad3e014b516..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 :class:`Warning`). -- Emit a deprecation warning if passed ``None``. From f13f1507378950f0f4a0e497cb774bb2e38df172 Mon Sep 17 00:00:00 2001 From: ericluoliu Date: Fri, 2 Jul 2021 16:04:53 -0700 Subject: [PATCH 6/7] fix issue 8447 doc --- changelog/8447.deprecation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/8447.deprecation.rst b/changelog/8447.deprecation.rst index 7d99654cad0..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 :class:`pytest.Item ` and a :class:pytest.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. From a8e720db3914a0af84cb0b8abb3e603f4b44f449 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 2 Jul 2021 23:06:09 +0000 Subject: [PATCH 7/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- changelog/7469.deprecation.rst | 2 +- changelog/8248.trivial.rst | 2 +- changelog/8645.deprecation.rst | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/changelog/7469.deprecation.rst b/changelog/7469.deprecation.rst index 98acf025b85..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 8.0.0. \ No newline at end of file +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/8248.trivial.rst b/changelog/8248.trivial.rst index 0015e6155cd..3044071fa81 100644 --- a/changelog/8248.trivial.rst +++ b/changelog/8248.trivial.rst @@ -1 +1 @@ -Internal Restructure: let ``python.PyObjMixin`` inherit from ``nodes.Node`` to carry over typing information. \ No newline at end of file +Internal Restructure: let ``python.PyObjMixin`` inherit from ``nodes.Node`` to carry over typing information. diff --git a/changelog/8645.deprecation.rst b/changelog/8645.deprecation.rst index 15a76ed8966..722a5d764de 100644 --- a/changelog/8645.deprecation.rst +++ b/changelog/8645.deprecation.rst @@ -1,4 +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 +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)``. \ No newline at end of file +or ``pytest.warns(Warning)``.