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

Function test_base_class_factory

test/asynchronous/unified_format.py:1604–1621  ·  view source on GitHub ↗

Utility that creates the base class to use for test generation. This is needed to ensure that cls.TEST_SPEC is appropriately set when the metaclass __init__ is invoked.

(test_spec)

Source from the content-addressed store, hash-verified

1602 test_klasses = {}
1603
1604 def test_base_class_factory(test_spec):
1605 """Utility that creates the base class to use for test generation.
1606 This is needed to ensure that cls.TEST_SPEC is appropriately set when
1607 the metaclass __init__ is invoked.
1608 """
1609
1610 class SpecTestBase(with_metaclass(UnifiedSpecTestMeta)): # type: ignore
1611 TEST_SPEC = test_spec
1612 EXPECTED_FAILURES = expected_failures
1613
1614 base = SpecTestBase
1615
1616 # Add "encryption" marker if the "csfle" runOnRequirement is set.
1617 for req in test_spec.get("runOnRequirements", []):
1618 if "csfle" in req:
1619 base = pytest.mark.encryption(base)
1620
1621 return base
1622
1623 found_any = False
1624 for dirpath, _, filenames in os.walk(test_path):

Callers 1

generate_test_classesFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected