(self)
| 755 | return self.obj() |
| 756 | |
| 757 | def collect(self) -> Iterable[nodes.Item | nodes.Collector]: |
| 758 | if not safe_getattr(self.obj, class="st">"__test__", True): |
| 759 | return [] |
| 760 | if hasinit(self.obj): |
| 761 | assert self.parent is not None |
| 762 | self.warn( |
| 763 | PytestCollectionWarning( |
| 764 | fclass="st">"cannot collect test class {self.obj.__name__!r} because it has a " |
| 765 | fclass="st">"__init__ constructor (from: {self.parent.nodeid})" |
| 766 | ) |
| 767 | ) |
| 768 | return [] |
| 769 | elif hasnew(self.obj): |
| 770 | assert self.parent is not None |
| 771 | self.warn( |
| 772 | PytestCollectionWarning( |
| 773 | fclass="st">"cannot collect test class {self.obj.__name__!r} because it has a " |
| 774 | fclass="st">"__new__ constructor (from: {self.parent.nodeid})" |
| 775 | ) |
| 776 | ) |
| 777 | return [] |
| 778 | |
| 779 | self._register_setup_class_fixture() |
| 780 | self._register_setup_method_fixture() |
| 781 | |
| 782 | self.session._fixturemanager.parsefactories( |
| 783 | holder=self.newinstance(), node=self |
| 784 | ) |
| 785 | |
| 786 | return super().collect() |
| 787 | |
| 788 | def _register_setup_class_fixture(self) -> None: |
| 789 | class="st">"""Register an autouse, class scoped fixture into the collected class object |
no test coverage detected