Skip to content

Commit

Permalink
set delete_many only if count_documents is not 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jib committed Mar 1, 2024
1 parent 2b93206 commit d41690d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ class TestMongoDBAtlasVectorSearch:
def setup_class(cls) -> None:
# insure the test collection is empty
collection = get_collection()
assert collection.count_documents({}) == 0 # type: ignore[index] # noqa: E501
if collection.count_documents({}):
collection.delete_many({}) # type: ignore[index] # noqa: E501

@classmethod
def teardown_class(cls) -> None:
Expand Down

0 comments on commit d41690d

Please sign in to comment.