From 5165bf97c6e1a76e22a3039f189cdd9824c6ffd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 12 Jul 2021 16:32:27 +0200 Subject: [PATCH] Revert "Adjust enum reprs for Python 3.10" (#8896) This reverts commit 710446420c0bb98f0761724ec865a894820bb610. The change was reverted in Python 3.10.0b4: https://mail.python.org/archives/list/python-dev@python.org/message/LSTMFAPSPD3BGZ4D6HQFODXZVB3PLYKF/ --- testing/python/metafunc.py | 5 +---- testing/test_pytester.py | 14 ++++---------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py index ce689e56d77..4a4b141c4b7 100644 --- a/testing/python/metafunc.py +++ b/testing/python/metafunc.py @@ -448,10 +448,7 @@ def test_idmaker_enum(self) -> None: enum = pytest.importorskip("enum") e = enum.Enum("Foo", "one, two") result = idmaker(("a", "b"), [pytest.param(e.one, e.two)]) - if sys.version_info[:2] >= (3, 10): - assert result == ["one-two"] - else: - assert result == ["Foo.one-Foo.two"] + assert result == ["Foo.one-Foo.two"] def test_idmaker_idfn(self) -> None: """#351""" diff --git a/testing/test_pytester.py b/testing/test_pytester.py index 19f28504d88..7b16c69c23d 100644 --- a/testing/test_pytester.py +++ b/testing/test_pytester.py @@ -744,16 +744,10 @@ def test_run_result_repr() -> None: # known exit code r = pytester_mod.RunResult(1, outlines, errlines, duration=0.5) - if sys.version_info[:2] >= (3, 10): - assert repr(r) == ( - "" - ) - else: - assert repr(r) == ( - "" - ) + assert ( + repr(r) == "" + ) # unknown exit code: just the number r = pytester_mod.RunResult(99, outlines, errlines, duration=0.5)