(self)
| 675 | ) |
| 676 | |
| 677 | def setup(self) -> None: |
| 678 | init_mod = importtestmodule(self.path / "__init__.py", self.config) |
| 679 | |
| 680 | # Not using fixtures to call setup_module here because autouse fixtures |
| 681 | # from packages are not called automatically (#4085). |
| 682 | setup_module = _get_first_non_fixture_func( |
| 683 | init_mod, ("setUpModule", "setup_module") |
| 684 | ) |
| 685 | if setup_module is not None: |
| 686 | _call_with_optional_argument(setup_module, init_mod) |
| 687 | |
| 688 | teardown_module = _get_first_non_fixture_func( |
| 689 | init_mod, ("tearDownModule", "teardown_module") |
| 690 | ) |
| 691 | if teardown_module is not None: |
| 692 | func = partial(_call_with_optional_argument, teardown_module, init_mod) |
| 693 | self.addfinalizer(func) |
| 694 | |
| 695 | def collect(self) -> Iterable[nodes.Item | nodes.Collector]: |
| 696 | # Always collect __init__.py first. |
nothing calls this directly
no test coverage detected