test_soap: use repr() to check error message (#38781)

This commit is contained in:
Emmanuel Cazenave 2020-01-22 16:59:45 +01:00
parent 438f253eda
commit 1812670c94
1 changed files with 2 additions and 1 deletions

View File

@ -52,8 +52,9 @@ def test_disable_strict_mode(mocked_post):
soap_resource = SOAPResource()
client = SOAPClient(soap_resource)
match = "Unexpected element %s, expected %s" % (repr(u'price'), repr(u'skipMe'))
with pytest.raises(
XMLParseError, match="Unexpected element u'price', expected u'skipMe'"):
XMLParseError, match=match):
client.service.GetLastTradePrice(tickerSymbol='banana')
client = SOAPClient(soap_resource, settings=Settings(strict=False))