Store a Mark on an object. This is used to implement the Mark declarations/decorators correctly.
(obj, mark: Mark)
| 386 | |
| 387 | |
| 388 | def store_mark(obj, mark: Mark) -> None: |
| 389 | """Store a Mark on an object. |
| 390 | |
| 391 | This is used to implement the Mark declarations/decorators correctly. |
| 392 | """ |
| 393 | assert isinstance(mark, Mark), mark |
| 394 | # Always reassign name to avoid updating pytestmark in a reference that |
| 395 | # was only borrowed. |
| 396 | obj.pytestmark = [*get_unpacked_marks(obj), mark] |
| 397 | |
| 398 | |
| 399 | # Typing for builtin pytest marks. This is cheating; it gives builtin marks |
no test coverage detected