diff --git a/dvc/repo/scm_context.py b/dvc/repo/scm_context.py index 7435f6378b..61b8e85805 100644 --- a/dvc/repo/scm_context.py +++ b/dvc/repo/scm_context.py @@ -10,6 +10,8 @@ from dvc.utils.collections import ensure_list if TYPE_CHECKING: + from typing_extensions import Self + from dvc.repo import Repo from dvc.scm import Base @@ -131,7 +133,7 @@ def __call__( self.files_to_track = set() - def __enter__(self) -> "SCMContext": + def __enter__(self) -> "Self": self._cm = self() return self._cm.__enter__() diff --git a/tests/unit/command/test_help.py b/tests/unit/command/test_help.py index 488cb63f4d..b483036b56 100644 --- a/tests/unit/command/test_help.py +++ b/tests/unit/command/test_help.py @@ -47,7 +47,7 @@ def test_help(caplog, capsys, command_tuples): out, err = capsys.readouterr() # validate metavars are all in lowercase - usage = "\n".join(takewhile(lambda o: bool(o), out.splitlines())) + usage = "\n".join(takewhile(bool, out.splitlines())) message = ( "metavars not lowercased, you are likely missing formatter_class=XXX "