(
request: FixtureRequest,
)
| 148 | raise ExceptionGroup("Unittest class cleanup errors", exceptions) |
| 149 | |
| 150 | def unittest_setup_class_fixture( |
| 151 | request: FixtureRequest, |
| 152 | ) -> Generator[None]: |
| 153 | cls = request.cls |
| 154 | if _is_skipped(cls): |
| 155 | reason = cls.__unittest_skip_why__ |
| 156 | raise skip.Exception(reason, _use_item_location=True) |
| 157 | if setup is not None: |
| 158 | try: |
| 159 | setup() |
| 160 | # unittest does not call the cleanup function for every BaseException, so we |
| 161 | # follow this here. |
| 162 | except Exception: |
| 163 | cleanup() |
| 164 | process_teardown_exceptions() |
| 165 | raise |
| 166 | yield |
| 167 | try: |
| 168 | if teardown is not None: |
| 169 | teardown() |
| 170 | finally: |
| 171 | cleanup() |
| 172 | process_teardown_exceptions() |
| 173 | |
| 174 | fixtures.register_fixture( |
| 175 | # Use a unique name to speed up lookup. |
nothing calls this directly
no test coverage detected