Skip to content

Commit

Permalink
Fix incorrect Self import from typing instead of typing_extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Aug 27, 2024
1 parent 05c43af commit e628783
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog/12744.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replaced `typing.Self` with `typing_extensions.Self` -- by :user:`Avasam`
3 changes: 2 additions & 1 deletion src/_pytest/doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@

if TYPE_CHECKING:
import doctest
from typing import Self

from typing_extensions import Self

DOCTEST_REPORT_CHOICE_NONE = "none"
DOCTEST_REPORT_CHOICE_CDIFF = "cdiff"
Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@


if TYPE_CHECKING:
from typing import Self
from typing_extensions import Self

# Imported here due to circular import.
from _pytest.main import Session
Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@


if TYPE_CHECKING:
from typing import Self
from typing_extensions import Self


def pytest_addoption(parser: Parser) -> None:
Expand Down

0 comments on commit e628783

Please sign in to comment.