We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b104ba commit 10d0b8bCopy full SHA for 10d0b8b
src/_pytest/_code/code.py
@@ -572,8 +572,9 @@ def match(self, regexp):
572
raised.
573
"""
574
__tracebackhide__ = True
575
- if not re.search(regexp, str(self.value)):
576
- assert 0, "Pattern '{!s}' not found in '{!s}'".format(regexp, self.value)
+ value = safe_str(self.value)
+ if not re.search(regexp, value):
577
+ assert 0, "Pattern {!r} not found in {!r}".format(regexp, value)
578
return True
579
580
testing/python/raises.py
@@ -278,3 +278,7 @@ def __class__(self):
278
with pytest.raises(CrappyClass()):
279
pass
280
assert "via __class__" in excinfo.value.args[0]
281
+
282
+ def test_u(self):
283
+ with pytest.raises(AssertionError, match=u"\u2603"):
284
+ assert False, u"\u2603"
0 commit comments