Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3b741ee

Browse files
Oleg GurevSofia Kopikova
Oleg Gurev
authored and
Sofia Kopikova
committed
[PBCKP-804] Test_AssertionError_Python3.11 (no attribute 'errors')
1 parent 2fd0dda commit 3b741ee

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/helpers/ptrack_helpers.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,12 @@ def is_test_result_ok(test_case):
423423
result = test_case.defaultTestResult() # These two methods have no side effects
424424
test_case._feedErrorsToResult(result, test_case._outcome.errors)
425425
else:
426-
# Python 3.11+
426+
# Python 3.11+ and pytest 5.3.5+
427427
result = test_case._outcome.result
428+
if not hasattr(result, 'errors'):
429+
result.errors = []
430+
if not hasattr(result, 'failures'):
431+
result.failures = []
428432
else: # Python 2.7, 3.0-3.3
429433
result = getattr(test_case, '_outcomeForDoCleanups', test_case._resultForDoCleanups)
430434

@@ -2252,4 +2256,4 @@ def __init__(self, is_datafile: bool):
22522256
self.is_datafile = is_datafile
22532257

22542258
class ContentDir(object):
2255-
__slots__ = ('mode')
2259+
__slots__ = ('mode')

0 commit comments

Comments
 (0)