File tree 2 files changed +14
-2
lines changed 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -577,7 +577,7 @@ def match(self, regexp):
577
577
)
578
578
if not re .search (regexp , value ):
579
579
raise AssertionError (
580
- u"Pattern '{}' not found in '{}' " .format (regexp , value )
580
+ u"Pattern {!r} not found in {!r} " .format (regexp , value )
581
581
)
582
582
return True
583
583
Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ def test_raises_match(self):
221
221
int ("asdf" )
222
222
223
223
msg = "with base 16"
224
- expr = r"Pattern '{}' not found in ' invalid literal for int\(\) with base 10: 'asdf'' " .format (
224
+ expr = r"Pattern '{}' not found in \" invalid literal for int\(\) with base 10: 'asdf'\" " .format (
225
225
msg
226
226
)
227
227
with pytest .raises (AssertionError , match = expr ):
@@ -305,6 +305,18 @@ class TestUnicodeHandling:
305
305
pytest .param (
306
306
u"hello" , b"world" , pytest .raises (AssertionError ), marks = py2_only
307
307
),
308
+ pytest .param (
309
+ u"😊" .encode ("UTF-8" ),
310
+ b"world" ,
311
+ pytest .raises (AssertionError ),
312
+ marks = py2_only ,
313
+ ),
314
+ pytest .param (
315
+ u"world" ,
316
+ u"😊" .encode ("UTF-8" ),
317
+ pytest .raises (AssertionError ),
318
+ marks = py2_only ,
319
+ ),
308
320
],
309
321
)
310
322
def test_handling (self , message , match , expectation ):
You can’t perform that action at this time.
0 commit comments