summaryrefslogtreecommitdiff
path: root/changelog/7469.feature.rst
blob: 66113aa580f010a600160a955655901e739decdc (plain)
1
2
3
4
5
6
7
8
9
10
11
The types of objects used in pytest's API are now exported so they may be used in type annotations.

The newly-exported types are:

- ``pytest.Mark`` for :class:`marks <pytest.Mark>`.
- ``pytest.MarkDecorator`` for :class:`mark decorators <pytest.MarkDecorator>`.

Constructing them directly is not supported; they are only meant for use in type annotations.
Doing so will emit a deprecation warning, and may become a hard-error in pytest 7.0.

Subclassing them is also not supported. This is not currently enforced at runtime, but is detected by type-checkers such as mypy.