From 7e9f7890dfa1f2283ac18fd561a28155f11e5759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Tue, 13 Apr 2021 21:45:57 +0200 Subject: [PATCH 1/1] Fix repr() checks for Python 3.10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stating Python 3.10 alpha 7, repr() was modified as follow: bpo-40066: Enum: adjust repr() to show only enum and member name (not value, nor angle brackets) and str() to show only member name. Update and improve documentation to match. bpo-40066: Enum’s repr() and str() have changed: repr() is now EnumClass.MemberName and str() is MemberName. Additionally, stdlib Enum’s whose contents are available as module attributes, such as RegexFlag.IGNORECASE, have their repr() as module.name, e.g. re.IGNORECASE. See https://bugs.python.org/issue40066 This commit fixes the assertions to match the new repr() behavior. Fix #1253 --- test/test_basic_logic.py | 2 +- test/test_events.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test_basic_logic.py b/test/test_basic_logic.py index fb54fe5..2e03e5d 100644 --- a/test/test_basic_logic.py +++ b/test/test_basic_logic.py @@ -1845,7 +1845,7 @@ class TestBasicServer(object): Ensure stream string representation is appropriate. """ s = h2.stream.H2Stream(4, None, 12, 14) - assert repr(s) == ">" + assert repr(s) == "" def sanity_check_data_frame(data_frame, diff --git a/test/test_events.py b/test/test_events.py index a6e8d83..c9250f8 100644 --- a/test/test_events.py +++ b/test/test_events.py @@ -209,7 +209,7 @@ class TestEventReprs(object): assert repr(e) == ( "" ) @@ -251,7 +251,7 @@ class TestEventReprs(object): assert repr(e) == ( "" + "error_code:ENHANCE_YOUR_CALM, remote_reset:False>" ) def test_pushedstreamreceived_repr(self): @@ -286,7 +286,7 @@ class TestEventReprs(object): assert repr(e) == ( "" ) @@ -319,7 +319,7 @@ class TestEventReprs(object): e.additional_data = additional_data assert repr(e) == ( - "" % data_repr ) -- 2.31.1