diff --git a/src/pyeval/plugin.py b/src/pyeval/plugin.py index 784f138..429e1c1 100644 --- a/src/pyeval/plugin.py +++ b/src/pyeval/plugin.py @@ -212,4 +212,6 @@ def runtest(self): def reportinfo(self): parent_name = f"{self.parent.name}:" if self.parent is not None else "" - return self.fspath, None, f"{parent_name}{self.name}" + # 0 is the pytest convention for synthetic items with no source line — + # see https://docs.pytest.org/en/stable/example/nonpython.html + return self.fspath, 0, f"{parent_name}{self.name}" diff --git a/tests/evals/eval_skipif.py b/tests/evals/eval_skipif.py new file mode 100644 index 0000000..c0a1689 --- /dev/null +++ b/tests/evals/eval_skipif.py @@ -0,0 +1,17 @@ +"""Regression test: pytestmark skipif must not cause INTERNALERROR.""" + +import pytest + +from pyeval import Case, dataset, execute + +pytestmark = pytest.mark.skipif( + True, + reason="always skipped — tests that EvalItem handles pytestmark skipif without INTERNALERROR", +) + + +@dataset( + Case(name="skipped_case", inputs="hello", expected_output="hello"), +) +def eval_skipif_regression(case): + execute(lambda x: x, case)