MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / create_tests

Function create_tests

test/test_discovery_and_monitoring.py:252–270  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

250
251
252def create_tests():
253 for dirpath, _, filenames in os.walk(SDAM_PATH):
254 dirname = os.path.split(dirpath)[-1]
255 # SDAM unified tests are handled separately.
256 if dirname == "unified":
257 continue
258
259 for filename in filenames:
260 if os.path.splitext(filename)[1] != ".json":
261 continue
262 with open(os.path.join(dirpath, filename)) as scenario_stream:
263 scenario_def = json_util.loads(scenario_stream.read())
264
265 # Construct test from scenario.
266 new_test = create_test(scenario_def)
267 test_name = f"test_{dirname}_{os.path.splitext(filename)[0]}"
268
269 new_test.__name__ = test_name
270 setattr(TestAllScenarios, new_test.__name__, new_test)
271
272
273create_tests()

Calls 3

create_testFunction · 0.70
joinMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected