-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
topic: fixturesanything involving fixtures directly or indirectlyanything involving fixtures directly or indirectlytopic: reportingrelated to terminal output and user-facing messages and errorsrelated to terminal output and user-facing messages and errors
Description
As mentioned in the XXX comment here:
pytest/src/_pytest/fixtures.py
Lines 1019 to 1032 in 6ed0051
| def finish(self, request: SubRequest) -> None: | |
| exc = None | |
| try: | |
| while self._finalizers: | |
| try: | |
| func = self._finalizers.pop() | |
| func() | |
| except BaseException as e: | |
| # XXX Only first exception will be seen by user, | |
| # ideally all should be reported. | |
| if exc is None: | |
| exc = e | |
| if exc: | |
| raise exc |
This means information on the extra errors that occurred is not reported, which should never happen ideally.
We should instead raise an exception group in this case, like we do for nodes since pytest 7.3 (#10226).
Metadata
Metadata
Assignees
Labels
topic: fixturesanything involving fixtures directly or indirectlyanything involving fixtures directly or indirectlytopic: reportingrelated to terminal output and user-facing messages and errorsrelated to terminal output and user-facing messages and errors