From 64ea79eb95752ed7554da36ccdd09ee13cddbfcd Mon Sep 17 00:00:00 2001 From: swryan Date: Thu, 28 Dec 2023 12:14:36 -0500 Subject: [PATCH 1/3] handle python 3.12.1 change to skip behavior --- testflo/utresult.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/testflo/utresult.py b/testflo/utresult.py index ad089c4..af87524 100644 --- a/testflo/utresult.py +++ b/testflo/utresult.py @@ -76,7 +76,12 @@ def addSuccess(self, test): def addSkip(self, test, reason): """Called when a test is skipped.""" - resdata = self._tests[test.id()] + # as of Python 3.12.1, startTest is not called before processing skips + # we will add the test to our list without calling the super() method + if test.id() not in self._tests: + resdata = self._tests[test.id()] = _ResultData(test) + else: + resdata = self._tests[test.id()] resdata.status = 'SKIP' resdata.error = reason super().addSkip(test, reason) From 4a0037bbfb9fb9bf8268d4566cbd55db80b0d6d8 Mon Sep 17 00:00:00 2001 From: swryan Date: Thu, 28 Dec 2023 12:19:07 -0500 Subject: [PATCH 2/3] clean up comment --- testflo/utresult.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testflo/utresult.py b/testflo/utresult.py index af87524..0bc9b0f 100644 --- a/testflo/utresult.py +++ b/testflo/utresult.py @@ -76,8 +76,8 @@ def addSuccess(self, test): def addSkip(self, test, reason): """Called when a test is skipped.""" - # as of Python 3.12.1, startTest is not called before processing skips - # we will add the test to our list without calling the super() method + # as of Python 3.12.1, startTest is not called before processing skips, so we + # will add the test to our list without calling the super() startTest method if test.id() not in self._tests: resdata = self._tests[test.id()] = _ResultData(test) else: From d0fc266fdccc248712ac2053207bfd80a1323b67 Mon Sep 17 00:00:00 2001 From: swryan Date: Thu, 28 Dec 2023 12:33:59 -0500 Subject: [PATCH 3/3] tweak comment --- testflo/utresult.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testflo/utresult.py b/testflo/utresult.py index 0bc9b0f..767cdff 100644 --- a/testflo/utresult.py +++ b/testflo/utresult.py @@ -77,7 +77,7 @@ def addSuccess(self, test): def addSkip(self, test, reason): """Called when a test is skipped.""" # as of Python 3.12.1, startTest is not called before processing skips, so we - # will add the test to our list without calling the super() startTest method + # add the test to our list without having called the super() startTest method if test.id() not in self._tests: resdata = self._tests[test.id()] = _ResultData(test) else: