Skip to content

Commit

Permalink
Fix test_errors_in_xfail_skip_expressions on Python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Compiler committed May 4, 2021
1 parent 61be48b commit 3825992
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions testing/test_skipping.py
Expand Up @@ -1143,21 +1143,34 @@ def test_func():
pypy_version_info = getattr(sys, "pypy_version_info", None)
if pypy_version_info is not None and pypy_version_info < (6,):
markline = markline[5:]
elif sys.version_info[:2] >= (3, 10):
markline = markline[11:]
elif sys.version_info >= (3, 8) or hasattr(sys, "pypy_version_info"):
markline = markline[4:]
result.stdout.fnmatch_lines(
[

if sys.version_info[:2] >= (3, 10):
expected = [
"*ERROR*test_nameerror*",
"*evaluating*skipif*condition*",
"*asd*",
"*ERROR*test_syntax*",
"*evaluating*xfail*condition*",
" syntax error",
markline,
"SyntaxError: invalid syntax",
"*1 pass*2 errors*",
"",
"During handling of the above exception, another exception occurred:",
]
)
else:
expected = [
"*ERROR*test_nameerror*",
]

expected += [
"*evaluating*skipif*condition*",
"*asd*",
"*ERROR*test_syntax*",
"*evaluating*xfail*condition*",
" syntax error",
markline,
"SyntaxError: invalid syntax",
"*1 pass*2 errors*",
]
result.stdout.fnmatch_lines(expected)


def test_xfail_skipif_with_globals(pytester: Pytester) -> None:
Expand Down

0 comments on commit 3825992

Please sign in to comment.