From af1b867430742247224c32e82bd77bbed4978c29 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Wed, 17 Apr 2024 14:47:12 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Fix=20test=20compatibility=20wit?= =?UTF-8?q?h=20Python=203.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Python 3.6 runtime seems to be adding a trailing comma in the argument lists of class `repr()`s. This patch takes that into account in the regexes used in tests for checking what's logged. --- cheroot/test/test_conn.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cheroot/test/test_conn.py b/cheroot/test/test_conn.py index 078d4d4d58..cbb079fbae 100644 --- a/cheroot/test/test_conn.py +++ b/cheroot/test/test_conn.py @@ -738,7 +738,7 @@ def _read_request_line(self): ( logging.CRITICAL, r'A fatal exception happened\. Setting the server interrupt flag ' - r'to ConnectionResetError\(666\) and giving up\.\n\nPlease, ' + r'to ConnectionResetError\(666,?\) and giving up\.\n\nPlease, ' 'report this on the Cheroot tracker at ' r', ' 'providing a full reproducer with as much context and details ' @@ -786,7 +786,7 @@ def _trigger_kb_intr(_req, _resp): ( logging.DEBUG, '^Setting the server interrupt flag to KeyboardInterrupt' - r"\('simulated test handler keyboard interrupt'\)$", + r"\('simulated test handler keyboard interrupt',?\)$", ), ( logging.INFO, @@ -855,7 +855,7 @@ def _trigger_scary_exc(_req, _resp): logging.ERROR, '^Unhandled error while processing an incoming connection ' 'SillyMistake' - r"\('simulated unhandled exception 💣 in test handler'\)$", + r"\('simulated unhandled exception 💣 in test handler',?\)$", ), ( logging.INFO, @@ -938,7 +938,7 @@ def _read_request_line(self): ( logging.ERROR, '^Unhandled error while processing an incoming connection ' - r'ScaryCrash\(666\)$', + r'ScaryCrash\(666,?\)$', ), ( logging.INFO,