Skip to content

Commit 935395b

Browse files
committed
🧪 Fix test compatibility with Python 3.6
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.
1 parent 688fc83 commit 935395b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cheroot/test/test_conn.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ def _read_request_line(self):
738738
(
739739
logging.CRITICAL,
740740
r'A fatal exception happened\. Setting the server interrupt flag '
741-
r'to ConnectionResetError\(666\) and giving up\.\n\nPlease, '
741+
r'to ConnectionResetError\(666,?\) and giving up\.\n\nPlease, '
742742
'report this on the Cheroot tracker at '
743743
r'<https://github\.com/cherrypy/cheroot/issues/new/choose>, '
744744
'providing a full reproducer with as much context and details '
@@ -786,7 +786,7 @@ def _trigger_kb_intr(_req, _resp):
786786
(
787787
logging.DEBUG,
788788
'^Setting the server interrupt flag to KeyboardInterrupt'
789-
r"\('simulated test handler keyboard interrupt'\)$",
789+
r"\('simulated test handler keyboard interrupt',?\)$",
790790
),
791791
(
792792
logging.INFO,
@@ -855,7 +855,7 @@ def _trigger_scary_exc(_req, _resp):
855855
logging.ERROR,
856856
'^Unhandled error while processing an incoming connection '
857857
'SillyMistake'
858-
r"\('simulated unhandled exception 💣 in test handler'\)$",
858+
r"\('simulated unhandled exception 💣 in test handler',?\)$",
859859
),
860860
(
861861
logging.INFO,
@@ -938,7 +938,7 @@ def _read_request_line(self):
938938
(
939939
logging.ERROR,
940940
'^Unhandled error while processing an incoming connection '
941-
r'ScaryCrash\(666\)$',
941+
r'ScaryCrash\(666,?\)$',
942942
),
943943
(
944944
logging.INFO,

0 commit comments

Comments
 (0)