MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_regression_nagative_line_index

Function test_regression_nagative_line_index

testing/code/test_excinfo.py:1400–1420  ·  view source on GitHub ↗

With Python 3.10 alphas, there was an INTERNALERROR reported in https://github.com/pytest-dev/pytest/pull/8227 This test ensures it does not regress.

(pytester: Pytester)

Source from the content-addressed store, hash-verified

1398
1399
1400def test_regression_nagative_line_index(pytester: Pytester) -> None:
1401 """
1402 With Python 3.10 alphas, there was an INTERNALERROR reported in
1403 https://github.com/pytest-dev/pytest/pull/8227
1404 This test ensures it does not regress.
1405 """
1406 pytester.makepyfile(
1407 """
1408 import ast
1409 import pytest
1410
1411
1412 def test_literal_eval():
1413 with pytest.raises(ValueError, match="^$"):
1414 ast.literal_eval("pytest")
1415 """
1416 )
1417 result = pytester.runpytest()
1418 result.stdout.fnmatch_lines(["* 1 failed in *"])
1419 result.stdout.no_fnmatch_line("*INTERNALERROR*")
1420 result.stderr.no_fnmatch_line("*INTERNALERROR*")
1421
1422
1423@pytest.mark.usefixtures("limited_recursion_depth")

Callers

nothing calls this directly

Calls 4

fnmatch_linesMethod · 0.80
no_fnmatch_lineMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected