Skip to content

Commit 529fa29

Browse files
committed
Fix test_errors_in_xfail_skip_expressions on Python 3.10
1 parent 61be48b commit 529fa29

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

testing/test_skipping.py

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,21 +1143,34 @@ def test_func():
11431143
pypy_version_info = getattr(sys, "pypy_version_info", None)
11441144
if pypy_version_info is not None and pypy_version_info < (6,):
11451145
markline = markline[5:]
1146+
elif sys.version_info[:2] >= (3, 10):
1147+
markline = markline[11:]
11461148
elif sys.version_info >= (3, 8) or hasattr(sys, "pypy_version_info"):
11471149
markline = markline[4:]
1148-
result.stdout.fnmatch_lines(
1149-
[
1150+
1151+
if sys.version_info[:2] >= (3, 10):
1152+
expected = [
11501153
"*ERROR*test_nameerror*",
1151-
"*evaluating*skipif*condition*",
11521154
"*asd*",
1153-
"*ERROR*test_syntax*",
1154-
"*evaluating*xfail*condition*",
1155-
" syntax error",
1156-
markline,
1157-
"SyntaxError: invalid syntax",
1158-
"*1 pass*2 errors*",
1155+
"",
1156+
"During handling of the above exception, another exception occurred:"
11591157
]
1160-
)
1158+
else:
1159+
expected = [
1160+
"*ERROR*test_nameerror*",
1161+
]
1162+
1163+
expected += [
1164+
"*evaluating*skipif*condition*",
1165+
"*asd*",
1166+
"*ERROR*test_syntax*",
1167+
"*evaluating*xfail*condition*",
1168+
" syntax error",
1169+
markline,
1170+
"SyntaxError: invalid syntax",
1171+
"*1 pass*2 errors*",
1172+
]
1173+
result.stdout.fnmatch_lines(expected)
11611174

11621175

11631176
def test_xfail_skipif_with_globals(pytester: Pytester) -> None:

0 commit comments

Comments
 (0)