Skip to content

Commit

Permalink
Tests: Improve robustness when database does not return records in order
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Jul 8, 2024
1 parent 958af36 commit d940a27
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/adapter/test_pymongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ def test_pymongo_tutorial(
# Getting a Single Document With find_one().
# https://pymongo.readthedocs.io/en/stable/tutorial.html#getting-a-single-document-with-find-one
document_loaded = posts.find_one({"author": "Mike"})
assert "mongodb" in document_loaded["tags"]
# Remark: Order of items is not guaranteed, so one of both records is returned.
assert "mongodb" in document_loaded["tags"] or "bulk" in document_loaded["tags"]

# Querying By ObjectId.
# https://pymongo.readthedocs.io/en/stable/tutorial.html#querying-by-objectid
Expand Down

0 comments on commit d940a27

Please sign in to comment.