MCPcopy
hub / github.com/pytest-dev/pytest / combined_with

Method combined_with

src/_pytest/mark/structures.py:287–312  ·  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

285 return "ids" in self.kwargs or len(self.args) >= 4
286
287 def combined_with(self, other: Mark) -> Mark:
288 """Return a new Mark which is a combination of this
289 Mark and another Mark.
290
291 Combines by appending args and merging kwargs.
292
293 :param Mark other: The mark to combine with.
294 :rtype: Mark
295 """
296 assert self.name == other.name
297
298 # Remember source of ids with parametrize Marks.
299 param_ids_from: Mark | None = None
300 if self.name == "parametrize":
301 if other._has_param_ids():
302 param_ids_from = other
303 elif self._has_param_ids():
304 param_ids_from = self
305
306 return Mark(
307 self.name,
308 self.args + other.args,
309 dict(self.kwargs, **other.kwargs),
310 param_ids_from=param_ids_from,
311 _ispytest=True,
312 )
313
314
315# 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