@@ -0,0 +1,1333 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0A    tests.nts.conftest%0A    ~~~~~~~~~~~~~~~~~~%0A%22%22%22%0Aimport pathlib%0A%0Aimport pytest%0Afrom tests.support.runtests import RUNTIME_VARS%0Afrom tests.support.unit import TestCase%0A%0ANTS_TEST_SUITE_PATH = pathlib.Path(__file__).parent%0A%0A%0A@pytest.hookimpl(hookwrapper=True, trylast=True)%0Adef pytest_collection_modifyitems(config, items):%0A    %22%22%22%0A    called after collection has been performed, may filter or re-order%0A    the items in-place.%0A%0A    :param _pytest.main.Session session: the pytest session object%0A    :param _pytest.config.Config config: pytest config object%0A    :param List%5B_pytest.nodes.Item%5D items: list of item objects%0A    %22%22%22%0A    # Let PyTest or other plugins handle the initial collection%0A    yield%0A%0A    # Check each collected item that's under this package to ensure that none is using TestCase as the base class%0A    for item in items:%0A        if not str(item.fspath).startswith(str(NTS_TEST_SUITE_PATH)):%0A            continue%0A        if not item.cls:%0A            # The test item is not part of a class%0A            continue%0A%0A        if issubclass(item.cls, TestCase):%0A            raise RuntimeError(%0A                %22The tests under %7B%7D MUST NOT use unittest's TestCase class%22.format(%0A                    pathlib.Path(str(item.fspath)).relative_to(RUNTIME_VARS.CODE_DIR)%0A                )%0A            )%0A

Enforce non TestCase usage under `tests/nts`