| 111 | |
| 112 | @classmethod |
| 113 | def param( |
| 114 | cls, |
| 115 | *values: object, |
| 116 | marks: MarkDecorator | Collection[MarkDecorator | Mark] = (), |
| 117 | id: str | _HiddenParam | None = None, |
| 118 | ) -> ParameterSet: |
| 119 | if isinstance(marks, MarkDecorator): |
| 120 | marks = (marks,) |
| 121 | else: |
| 122 | assert isinstance(marks, collections.abc.Collection) |
| 123 | if any(i.name == class="st">"usefixtures" for i in marks): |
| 124 | raise ValueError( |
| 125 | class="st">"pytest.param cannot add pytest.mark.usefixtures; see " |
| 126 | class="st">"https://docs.pytest.org/en/stable/reference/reference.htmlclass="cm">#pytest-param" |
| 127 | ) |
| 128 | |
| 129 | if id is not None: |
| 130 | if not isinstance(id, str) and id is not HIDDEN_PARAM: |
| 131 | raise TypeError( |
| 132 | class="st">"Expected id to be a string or a `pytest.HIDDEN_PARAM` sentinel, " |
| 133 | fclass="st">"got {type(id)}: {id!r}", |
| 134 | ) |
| 135 | return cls(values, marks, id) |
| 136 | |
| 137 | @classmethod |
| 138 | def extract_from( |