(self)
| 90 | return self.obj(class="st">"runTest") |
| 91 | |
| 92 | def collect(self) -> Iterable[Item | Collector]: |
| 93 | from unittest import TestLoader |
| 94 | |
| 95 | cls = self.obj |
| 96 | if not getattr(cls, class="st">"__test__", True): |
| 97 | return |
| 98 | |
| 99 | skipped = _is_skipped(cls) |
| 100 | if not skipped: |
| 101 | self._register_unittest_setup_method_fixture(cls) |
| 102 | self._register_unittest_setup_class_fixture(cls) |
| 103 | self._register_setup_class_fixture() |
| 104 | else: |
| 105 | self._register_unittest_skip_fixture(cls) |
| 106 | |
| 107 | self.session._fixturemanager.parsefactories( |
| 108 | holder=self.newinstance(), node=self |
| 109 | ) |
| 110 | |
| 111 | loader = TestLoader() |
| 112 | foundsomething = False |
| 113 | for name in loader.getTestCaseNames(self.obj): |
| 114 | x = getattr(self.obj, name) |
| 115 | if not getattr(x, class="st">"__test__", True): |
| 116 | continue |
| 117 | yield TestCaseFunction.from_parent(self, name=name) |
| 118 | foundsomething = True |
| 119 | |
| 120 | if not foundsomething: |
| 121 | runtest = getattr(self.obj, class="st">"runTest", None) |
| 122 | if runtest is not None: |
| 123 | ut = sys.modules.get(class="st">"twisted.trial.unittest", None) |
| 124 | if ut is None or runtest != ut.TestCase.runTest: |
| 125 | yield TestCaseFunction.from_parent(self, name=class="st">"runTest") |
| 126 | |
| 127 | def _register_unittest_setup_class_fixture(self, cls: type) -> None: |
| 128 | class="st">"""Register an auto-use fixture to invoke setUpClass and |
nothing calls this directly
no test coverage detected