Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3b741ee

Browse filesBrowse 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
Copy full SHA for 3b741ee

File tree

1 file changed

+6
-2
lines changed
Filter options

1 file changed

+6
-2
lines changed

‎tests/helpers/ptrack_helpers.py

Copy file name to clipboardExpand all lines: tests/helpers/ptrack_helpers.py
+6-2Lines changed: 6 additions & 2 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.