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")
| 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 |
no test coverage detected