diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index cead6c3113c..08dfeca1b60 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -321,7 +321,7 @@ def get_user_id() -> int | None: return None # getuid shouldn't fail, but cpython defines such a case. # Let's hope for the best. - uid = os.getuid() + uid = os.getuid() # type: ignore[attr-defined] return uid if uid != -1 else None diff --git a/testing/test_parseopt.py b/testing/test_parseopt.py index 1899abe153f..b6df035aacf 100644 --- a/testing/test_parseopt.py +++ b/testing/test_parseopt.py @@ -291,7 +291,8 @@ def test_multiple_metavar_help(self, parser: parseopt.Parser) -> None: def test_argcomplete(pytester: Pytester, monkeypatch: MonkeyPatch) -> None: try: - encoding = locale.getencoding() # New in Python 3.11, ignores utf-8 mode + # New in Python 3.11, ignores utf-8 mode + encoding = locale.getencoding() # type: ignore[attr-defined] except AttributeError: encoding = locale.getpreferredencoding(False) try: