Skip to content

Commit

Permalink
style: nicefied test code
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Kryukov committed Dec 16, 2022
1 parent e281d8e commit 40305eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_mongo_thingy.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ class Something(AsyncThingy):
something1 = Something(field1='A', field2=':)', related=[])
await something1.save()

with pytest.raises(DuplicateKeyError, match="^E11000 Duplicate Key Error, full error: {'keyValue': {'field1': 'A'}, 'keyPattern': {'field1': 1}}$"):
with pytest.raises(
DuplicateKeyError,
match="^E11000 Duplicate Key Error, full error: {'keyValue': {'field1': 'A'}, 'keyPattern': {'field1': 1}}$",
):
duplicate = Something(field1='A', field2=':)', related=[])
await duplicate.save()

Expand Down

0 comments on commit 40305eb

Please sign in to comment.