Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions testtools/testresult/real.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ def startTest(self, test):
self._tags = TagContext(self._tags)

def stopTest(self, test):
self._tags = self._tags.parent
# NOTE: In Python 3.12.1 skipped tests may not call startTest()
if self._tags is not None:
self._tags = self._tags.parent
super().stopTest(test)

@property
Expand Down Expand Up @@ -1608,7 +1610,9 @@ def stop(self):
self.shouldStop = True

def stopTest(self, test):
self._tags = self._tags.parent
# NOTE: In Python 3.12.1 skipped tests may not call startTest()
if self._tags is not None:
self._tags = self._tags.parent
return self.decorated.stopTest(test)

def stopTestRun(self):
Expand Down Expand Up @@ -1670,7 +1674,9 @@ def startTest(self, test):
self._tags = TagContext(self._tags)

def stopTest(self, test):
self._tags = self._tags.parent
# NOTE: In Python 3.12.1 skipped tests may not call startTest()
if self._tags is not None:
self._tags = self._tags.parent

def addError(self, test, err=None, details=None):
self._check_args(err, details)
Expand Down