Skip to content

Commit b862af1

Browse files
Copilotlarp0
andcommitted
Fix mypy type annotation errors in pytest_xprocess_compat.py and conftest.py
Co-authored-by: larp0 <[email protected]>
1 parent 969ad86 commit b862af1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

python/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
import pytest_xprocess_compat # noqa: F401
1212

1313

14-
@pytest.fixture(scope="session")
14+
@pytest.fixture(scope="session") # type: ignore[misc]
1515
def event_loop() -> Generator[asyncio.AbstractEventLoop, None, None]:
1616
"""Create an instance of the default event loop for the test session."""
1717
loop = asyncio.get_event_loop_policy().new_event_loop()
1818
yield loop
1919
loop.close()
2020

2121

22-
@pytest.fixture(autouse=True)
23-
def mock_environment():
22+
@pytest.fixture(autouse=True) # type: ignore[misc]
23+
def mock_environment() -> None:
2424
"""Set up mock environment variables for testing."""
2525
import os
2626

python/pytest_xprocess_compat.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
from types import ModuleType
1010

1111

12-
def getrootdir():
12+
def getrootdir() -> str:
1313
"""Compatibility function for pytest_xprocess.getrootdir"""
1414
return tempfile.gettempdir()
1515

1616

1717
# Create a comprehensive mock pytest_xprocess module
1818
mock_module = ModuleType("pytest_xprocess")
19-
mock_module.getrootdir = getrootdir
19+
mock_module.getrootdir = getrootdir # type: ignore
2020

2121
# Add other commonly expected attributes to avoid import errors
22-
mock_module.__version__ = "1.0.0"
22+
mock_module.__version__ = "1.0.0" # type: ignore
2323
mock_module.__file__ = __file__
2424

2525
# Patch sys.modules early to prevent import errors

0 commit comments

Comments
 (0)