Skip to content

Commit 502b598

Browse files
committed
PYTHON-2006 Fix DuplicateKeyError in custom types test
1 parent 3236994 commit 502b598

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/test_custom_types.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,8 +863,9 @@ def create_targets(self, *args, **kwargs):
863863
self.watched_target = self.db.get_collection(
864864
'test', *args, **kwargs)
865865
self.input_target = self.watched_target
866-
# Insert a record to ensure db, coll are created.
867-
self.input_target.insert_one({'data': 'dummy'})
866+
# Ensure the collection exists and is empty.
867+
self.input_target.insert_one({})
868+
self.input_target.delete_many({})
868869

869870

870871
class TestDatabaseChangeStreamsWCustomTypes(

0 commit comments

Comments
 (0)