Skip to content

Commit aac8d63

Browse files
committed
PYTHON-1935 Only create test crud v2 collection if there's data to insert
1 parent 243307b commit aac8d63

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/test_crud_v2.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ def get_outcome_coll_name(self, outcome, collection):
5050
"""Crud spec says outcome has an optional 'collection.name'."""
5151
return outcome['collection'].get('name', collection.name)
5252

53+
def setup_scenario(self, scenario_def):
54+
"""Allow specs to override a test's setup."""
55+
# PYTHON-1935 Only create the collection if there is data to insert.
56+
if scenario_def['data']:
57+
super(TestSpec, self).setup_scenario(scenario_def)
58+
5359

5460
def create_test(scenario_def, test, name):
5561
def run_scenario(self):

0 commit comments

Comments
 (0)