diff --git a/tests/log_fixtures.py b/tests/log_fixtures.py index 3290c340..b304027f 100644 --- a/tests/log_fixtures.py +++ b/tests/log_fixtures.py @@ -82,7 +82,7 @@ def new_scope(self, *, when: TestPhase = "call") -> Scope: return self.Scope(self, self.push(when=when), contextlib.ExitStack()) -@pytest.fixture +@pytest.fixture() def log_handler_stack( caplog: pytest.LogCaptureFixture, _with_sphinx_logs: None ) -> LogStackFixture: @@ -90,13 +90,13 @@ def log_handler_stack( return LogStackFixture(caplog) -@pytest.fixture +@pytest.fixture() def expected_logs_impl() -> set[logging.LogRecord]: """Implementation of expected_logs""" return set() -@pytest.fixture +@pytest.fixture() def _no_unexpected_warnings_impl( request: pytest.FixtureRequest, log_handler_stack: LogStackFixture, @@ -140,7 +140,7 @@ def validate(self, records: Iterable[logging.LogRecord]) -> None: # Must request no_unexpected_warnings_ to ensure its teardown runs *after* # other fixtures that request expected_logs -@pytest.fixture +@pytest.fixture() def expected_logs( _no_unexpected_warnings_impl: None, expected_logs_impl: set[logging.LogRecord], @@ -149,7 +149,7 @@ def expected_logs( return expected_logs_impl -@pytest.fixture +@pytest.fixture() def _no_unexpected_warnings( _no_unexpected_warnings_impl: None, ) -> None: @@ -253,7 +253,7 @@ def __call__( ) -@pytest.fixture +@pytest.fixture() def expect_log( log_handler_stack: LogStackFixture, expected_logs: set[logging.LogRecord] ) -> ExpectLogFixture: @@ -266,7 +266,7 @@ def expect_log( return ExpectLogFixture(log_handler_stack, expected_logs) -@pytest.fixture +@pytest.fixture() def _with_sphinx_logs(monkeypatch: pytest.MonkeyPatch) -> None: """Fixture to enable capturing sphinx logs in pytest""" monkeypatch.setattr("sphinx.util.logging.setup", unittest.mock.Mock()) diff --git a/tests/projects_fixtures.py b/tests/projects_fixtures.py index 60cf67c4..b919cbee 100644 --- a/tests/projects_fixtures.py +++ b/tests/projects_fixtures.py @@ -9,7 +9,7 @@ import rocm_docs.projects -@pytest.fixture +@pytest.fixture() def mock_projects( monkeypatch: pytest.MonkeyPatch, ) -> Callable[[dict[str, rocm_docs.projects._Project]], None]: @@ -24,7 +24,7 @@ def do_mock(projects: dict[str, rocm_docs.projects._Project]) -> None: return do_mock -@pytest.fixture +@pytest.fixture() def mocked_projects( mock_projects: Callable[[dict[str, rocm_docs.projects._Project]], None], ) -> dict[str, rocm_docs.projects._Project]: diff --git a/tests/sphinx_fixtures.py b/tests/sphinx_fixtures.py index 757883e2..a216d372 100644 --- a/tests/sphinx_fixtures.py +++ b/tests/sphinx_fixtures.py @@ -13,7 +13,7 @@ from .log_fixtures import ExpectLogFixture -@pytest.fixture +@pytest.fixture() def with_no_git_repo( monkeypatch: pytest.MonkeyPatch, expect_log: ExpectLogFixture, @@ -42,7 +42,7 @@ def build_sphinx( app.build() -@pytest.fixture +@pytest.fixture() def build_factory( request: pytest.FixtureRequest, tmp_path: Path, diff --git a/tests/test_meta.py b/tests/test_meta.py index 716bbfe6..c5cafd48 100644 --- a/tests/test_meta.py +++ b/tests/test_meta.py @@ -29,7 +29,7 @@ def test_scope_of_log_stack(expect_log: ExpectLogFixture) -> None: @pytest.mark.usefixtures("_no_unexpected_warnings") -@pytest.mark.meta_invert_fixture +@pytest.mark.meta_invert_fixture() def test_unexpected_warnings() -> None: logger.warning("An unexpected warning")