@@ -230,8 +230,8 @@ def test_strip_exc_timestamps_function(self):
230230 # Verify original strings have timestamps and stripped ones don't
231231 self .assertIn ("ZeroDivisionError: division by zero <@" , output )
232232 self .assertNotIn ("ZeroDivisionError: division by zero\n " , output )
233- self .assertRegex (stripped_output , r "(?m)ZeroDivisionError: division by zero$ " )
234- self .assertRegex (stripped_output , r "(?m)FakeError: not an exception$ " )
233+ self .assertRegex (stripped_output , "(?m)ZeroDivisionError: division by zero( \r | \n |$) " )
234+ self .assertRegex (stripped_output , "(?m)FakeError: not an exception( \r | \n |$) " )
235235
236236 @force_not_colorized
237237 def test_strip_exc_timestamps_with_disabled_timestamps (self ):
@@ -249,10 +249,10 @@ def test_strip_exc_timestamps_with_disabled_timestamps(self):
249249 stripped_output = result .out .decode () + result .err .decode (errors = 'ignore' )
250250
251251 # All strings should be unchanged by the strip function
252- self .assertRegex (stripped_output , r "(?m)ZeroDivisionError: division by zero$ " )
252+ self .assertRegex (stripped_output , "(?m)ZeroDivisionError: division by zero( \r | \n |$) " )
253253 # it fits the pattern but traceback timestamps were disabled to strip_exc_timestamps does nothing.
254254 self .assertRegex (
255- stripped_output , r "(?m)FakeError: not an exception <@1234567890.123456>$ "
255+ stripped_output , "(?m)FakeError: not an exception <@1234567890.123456>( \r | \n |$) "
256256 )
257257
258258 def test_timestamp_regex_pattern (self ):
0 commit comments