Skip to content

Commit 9390852

Browse files
authored
Fix a warning in modern unittest. (#773)
Newer versions of unittest no longer store an errors list; instead, they store a result, which then stores an error list. Update the code here to be able to deal with either version. Signed-off-by: Chris Lalancette <[email protected]>
1 parent 72ffcb5 commit 9390852

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

launch_testing/launch_testing/markers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ def _wrapper(self, *args, **kwargs):
4949
assert self._outcome.success
5050
return ret
5151
except AssertionError:
52-
self._outcome.errors.clear()
52+
if hasattr(self._outcome, 'errors'):
53+
self._outcome.errors.clear()
54+
else:
55+
if self._outcome.result is not None:
56+
self._outcome.result.errors.clear()
5357
self._outcome.success = True
5458
n -= 1
5559
if delay is not None:

0 commit comments

Comments
 (0)