fix remaining assertRaises

This commit is contained in:
Bastien Gérard
2019-08-31 22:40:54 +03:00
parent ac25f4b98b
commit 3e764d068c
10 changed files with 76 additions and 80 deletions

View File

@@ -595,12 +595,12 @@ class TestIndexes(unittest.TestCase):
Blog.drop_collection()
with pytest.raises(OperationFailure) as ctx_err:
with pytest.raises(OperationFailure) as exc_info:
Blog(id="garbage").save()
# One of the errors below should happen. Which one depends on the
# PyMongo version and dict order.
err_msg = str(ctx_err.exception)
err_msg = str(exc_info.value)
assert any(
[
"The field 'unique' is not valid for an _id index specification"