Skip to content

Commit b305ef4

Browse files
committed
Fix regressions
1 parent 9b02562 commit b305ef4

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

testtools/tests/helpers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ def addError(self, test, err=None, details=None):
5454
super().addError(test, err, details)
5555

5656
def addSkip(self, test, reason=None, details=None):
57+
# Extract reason from details if not provided directly
58+
if reason is None and details and "reason" in details:
59+
reason = details["reason"].as_text()
5760
self._events.append(("addSkip", test, reason))
5861
super().addSkip(test, reason, details)
5962

testtools/tests/matchers/test_higherorder.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ class TestAnyMatch(TestCase, TestMatchersInterface):
8181
]
8282

8383

84-
class TestAfterPreprocessing(TestCase, TestMatchersInterface):
85-
@staticmethod
86-
def parity(x):
87-
return x % 2
84+
def parity(x):
85+
return x % 2
86+
8887

88+
class TestAfterPreprocessing(TestCase, TestMatchersInterface):
8989
matches_matcher: ClassVar = AfterPreprocessing(parity, Equals(1))
9090
matches_matches: ClassVar = [3, 5]
9191
matches_mismatches: ClassVar = [2]

0 commit comments

Comments
 (0)