Techdebt: Sure - Documentation (#6051)

This commit is contained in:
Hans Donner 2023-03-11 16:37:02 +01:00 committed by GitHub
parent 1934d24ad5
commit bb60ea3594
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,9 +17,9 @@ When writing negative tests, try to use the following format:
with pytest.raises(botocore.exceptions.ClientError) as exc:
client.failing_call(..)
err = exc.value.response["Error"]
# These assertions use the 'sure' library, but any assertion style is accepted
err["Code"].should.equal(..)
err["Message"].should.equal(..)
# Use the pytest assert method, see https://docs.pytest.org/en/stable/how-to/assert.html#
assert err["Code"] == ..
assert err["Message"] == ..
This is the best way to ensure that exceptions are dealt with correctly by Moto.