Use unicode message if regex is also unicode in ExceptionInfo.match

This commit is contained in:
Bruno Oliveira
2019-06-30 10:34:40 -03:00
parent 86a4eb6008
commit 09dee292ca
2 changed files with 9 additions and 3 deletions

View File

@@ -279,6 +279,8 @@ class TestRaises(object):
pass
assert "via __class__" in excinfo.value.args[0]
def test_u(self):
def test_unicode_message(self):
"""pytest.raises should be able to match unicode messages when using a unicode regex (#5478)
"""
with pytest.raises(AssertionError, match=u"\u2603"):
assert False, u"\u2603"