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

Function get_empty_parameterset_mark

src/_pytest/mark/structures.py:46–72  ·  view source on GitHub ↗
(
    config: Config, argnames: Sequence[str], func
)

Source from the content-addressed store, hash-verified

44
45
46def get_empty_parameterset_mark(
47 config: Config, argnames: Sequence[str], func
48) -> "MarkDecorator":
49 from ..nodes import Collector
50
51 fs, lineno = getfslineno(func)
52 reason = "got empty parameter set %r, function %s at %s:%d" % (
53 argnames,
54 func.__name__,
55 fs,
56 lineno,
57 )
58
59 requested_mark = config.getini(EMPTY_PARAMETERSET_OPTION)
60 if requested_mark in ("", None, "skip"):
61 mark = MARK_GEN.skip(reason=reason)
62 elif requested_mark == "xfail":
63 mark = MARK_GEN.xfail(reason=reason, run=False)
64 elif requested_mark == "fail_at_collect":
65 f_name = func.__name__
66 _, lineno = getfslineno(func)
67 raise Collector.CollectError(
68 "Empty parameter set in '%s' at line %d" % (f_name, lineno + 1)
69 )
70 else:
71 raise LookupError(requested_mark)
72 return mark
73
74
75class ParameterSet(

Calls 2

getfslinenoFunction · 0.85
getiniMethod · 0.45