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)
| 1587 | test_klasses = {} |
| 1588 | |
| 1589 | def test_base_class_factory(test_spec): |
| 1590 | """Utility that creates the base class to use for test generation. |
| 1591 | This is needed to ensure that cls.TEST_SPEC is appropriately set when |
| 1592 | the metaclass __init__ is invoked. |
| 1593 | """ |
| 1594 | |
| 1595 | class SpecTestBase(with_metaclass(UnifiedSpecTestMeta)): # type: ignore |
| 1596 | TEST_SPEC = test_spec |
| 1597 | EXPECTED_FAILURES = expected_failures |
| 1598 | |
| 1599 | base = SpecTestBase |
| 1600 | |
| 1601 | # Add "encryption" marker if the "csfle" runOnRequirement is set. |
| 1602 | for req in test_spec.get("runOnRequirements", []): |
| 1603 | if "csfle" in req: |
| 1604 | base = pytest.mark.encryption(base) |
| 1605 | |
| 1606 | return base |
| 1607 | |
| 1608 | found_any = False |
| 1609 | for dirpath, _, filenames in os.walk(test_path): |
no test coverage detected