Return a MarkDecorator with extra arguments added. Unlike calling the MarkDecorator, with_args() can be used even if the sole argument is a callable/class.
(self, *args: object, **kwargs: object)
| 330 | return self.name # for backward-compat (2.4.1 had this attr) |
| 331 | |
| 332 | def with_args(self, *args: object, **kwargs: object) -> "MarkDecorator": |
| 333 | """Return a MarkDecorator with extra arguments added. |
| 334 | |
| 335 | Unlike calling the MarkDecorator, with_args() can be used even |
| 336 | if the sole argument is a callable/class. |
| 337 | """ |
| 338 | mark = Mark(self.name, args, kwargs, _ispytest=True) |
| 339 | return MarkDecorator(self.mark.combined_with(mark), _ispytest=True) |
| 340 | |
| 341 | # Type ignored because the overloads overlap with an incompatible |
| 342 | # return type. Not much we can do about that. Thankfully mypy picks |