Skip to content

Commit

Permalink
style: Apply ruff formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
samjwu committed Dec 24, 2024
1 parent 40c0225 commit 6febef6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions tests/log_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,21 @@ 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:
"""A fixture allowing scoped log handling"""
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,
Expand Down Expand Up @@ -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],
Expand All @@ -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:
Expand Down Expand Up @@ -253,7 +253,7 @@ def __call__(
)


@pytest.fixture
@pytest.fixture()
def expect_log(
log_handler_stack: LogStackFixture, expected_logs: set[logging.LogRecord]
) -> ExpectLogFixture:
Expand All @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions tests/projects_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand All @@ -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]:
Expand Down
4 changes: 2 additions & 2 deletions tests/sphinx_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from .log_fixtures import ExpectLogFixture


@pytest.fixture
@pytest.fixture()
def with_no_git_repo(
monkeypatch: pytest.MonkeyPatch,
expect_log: ExpectLogFixture,
Expand Down Expand Up @@ -42,7 +42,7 @@ def build_sphinx(
app.build()


@pytest.fixture
@pytest.fixture()
def build_factory(
request: pytest.FixtureRequest,
tmp_path: Path,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit 6febef6

Please sign in to comment.