Skip to content

Commit

Permalink
🧪 Fix test compatibility with Python 3.6
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
webknjaz committed Apr 17, 2024
1 parent b1f7384 commit af1b867
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cheroot/test/test_conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'<https://github\.com/cherrypy/cheroot/issues/new/choose>, '
'providing a full reproducer with as much context and details '
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit af1b867

Please sign in to comment.