Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 502b598

Browse filesBrowse files
committed
PYTHON-2006 Fix DuplicateKeyError in custom types test
1 parent 3236994 commit 502b598
Copy full SHA for 502b598

File tree

Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Open diff view settings
Collapse file

‎test/test_custom_types.py‎

Copy file name to clipboardExpand all lines: test/test_custom_types.py
+3-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.