Skip to content

Commit

Permalink
topotato: catch Failed and Skipped too
Browse files Browse the repository at this point in the history
`Skipped` isn't a subclass of `Exception`, this was causing later test
items to fail due to the network not being started.

Signed-off-by: David Lamparter <[email protected]>
  • Loading branch information
eqvinox committed Sep 6, 2024
1 parent 8b599be commit c2fa718
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions topotato/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import pytest
import _pytest
from _pytest import nodes
from _pytest.outcomes import Failed, Skipped

# from _pytest.mark.structures import Mark

Expand Down Expand Up @@ -442,7 +443,7 @@ def setup(self):
# pylint: disable=protected-access
try:
tcls.netinst = tcls.obj._setup(self.session, tcls.nodeid).prepare()
except Exception as e:
except (Exception, Failed, Skipped) as e:
e.topotato_node = self
self.parent.skipall = e
raise
Expand All @@ -457,7 +458,7 @@ def runtest(self):
e.topotato_node = self
self.parent.skipall = e
raise
except Exception as e:
except (Exception, Failed, Skipped) as e:
e.topotato_node = self
self.parent.skipall = e
raise
Expand Down Expand Up @@ -744,7 +745,7 @@ class TopotatoClass(_pytest.python.Class):
The actual instance of our test class.
"""

skipall: Optional[Exception]
skipall: Optional[Exception | Failed | Skipped]

starting_ts: float
started_ts: float
Expand Down

0 comments on commit c2fa718

Please sign in to comment.