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

Method combined_with

src/_pytest/mark/structures.py:235–260  ·  view source on GitHub ↗

Return a new Mark which is a combination of this Mark and another Mark. Combines by appending args and merging kwargs. :param Mark other: The mark to combine with. :rtype: Mark

(self, other: "Mark")

Source from the content-addressed store, hash-verified

233 return "ids" in self.kwargs or len(self.args) >= 4
234
235 def combined_with(self, other: "Mark") -> "Mark":
236 """Return a new Mark which is a combination of this
237 Mark and another Mark.
238
239 Combines by appending args and merging kwargs.
240
241 :param Mark other: The mark to combine with.
242 :rtype: Mark
243 """
244 assert self.name == other.name
245
246 # Remember source of ids with parametrize Marks.
247 param_ids_from: Optional[Mark] = None
248 if self.name == "parametrize":
249 if other._has_param_ids():
250 param_ids_from = other
251 elif self._has_param_ids():
252 param_ids_from = self
253
254 return Mark(
255 self.name,
256 self.args + other.args,
257 dict(self.kwargs, **other.kwargs),
258 param_ids_from=param_ids_from,
259 _ispytest=True,
260 )
261
262
263# A generic parameter designating an object to which a Mark may

Callers 1

with_argsMethod · 0.80

Calls 2

_has_param_idsMethod · 0.95
MarkClass · 0.85

Tested by

no test coverage detected