Skip to content

Commit

Permalink
Update pre-commit hooks (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Oct 24, 2024
1 parent 1b68590 commit b18efe7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ repos:
- id: tox-ini-fmt

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
rev: v0.7.0
hooks:
- id: ruff
args:
Expand All @@ -75,12 +75,12 @@ repos:
types_or: [python, pyi]

- repo: https://github.com/psf/black # must be after ruff
rev: 24.8.0
rev: 24.10.0
hooks:
- id: black

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.13.3
rev: v8.15.2
hooks:
- id: cspell
name: Spell check with cspell
Expand Down Expand Up @@ -110,7 +110,7 @@ repos:
- pyyaml

- repo: https://github.com/pre-commit/mirrors-mypy.git
rev: v1.11.2
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies:
Expand Down
10 changes: 5 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def _exec_container(command: str) -> subprocess.CompletedProcess[str]:
)


@pytest.fixture()
@pytest.fixture
def exec_container() -> Callable[[str], subprocess.CompletedProcess[str]]:
"""Run the container.
Expand Down Expand Up @@ -450,7 +450,7 @@ def _stop_server() -> None:
INFRASTRUCTURE.proc = None


@pytest.fixture()
@pytest.fixture
def test_fixture_dir(request: pytest.FixtureRequest) -> Path:
"""Provide the fixture directory for a given test.
Expand All @@ -463,7 +463,7 @@ def test_fixture_dir(request: pytest.FixtureRequest) -> Path:
return FIXTURES_DIR / request.path.relative_to(Path(__file__).parent).with_suffix("")


@pytest.fixture()
@pytest.fixture
def test_fixture_dir_container(request: pytest.FixtureRequest) -> Path:
"""Provide the fixture directory for a given test within the container.
Expand All @@ -478,7 +478,7 @@ def test_fixture_dir_container(request: pytest.FixtureRequest) -> Path:
).with_suffix("")


@pytest.fixture()
@pytest.fixture
def infrastructure() -> Infrastructure:
"""Provide the infrastructure.
Expand Down Expand Up @@ -556,7 +556,7 @@ def _cmd_in_tty( # noqa: C901
return result[m_stdout].decode("utf-8"), result[m_stderr].decode("utf-8"), proc.returncode


@pytest.fixture()
@pytest.fixture
def cmd_in_tty() -> Callable[..., tuple[str, str, int]]:
"""Provide the cmd in tty function as a fixture.
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from tests.conftest import Infrastructure


@pytest.fixture()
@pytest.fixture
def session_params() -> dict[str, int]:
"""Set the tmux session parameters.
Expand Down Expand Up @@ -88,7 +88,7 @@ def exit(self) -> None:
self.send_and_wait(cmd="exit", wait_for="")


@pytest.fixture()
@pytest.fixture
def container_tmux(
infrastructure: Infrastructure,
session: Session,
Expand Down
30 changes: 15 additions & 15 deletions tests/integration/test_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from .conftest import ContainerTmux


@pytest.mark.container()
@pytest.mark.container
def test_versions(exec_container: Callable[[str], subprocess.CompletedProcess[str]]) -> None:
"""Test the versions.
Expand All @@ -36,7 +36,7 @@ def test_versions(exec_container: Callable[[str], subprocess.CompletedProcess[st
assert pkg in versions.stdout, f"{pkg} not found in version output"


@pytest.mark.container()
@pytest.mark.container
def test_podman(exec_container: Callable[[str], subprocess.CompletedProcess[str]]) -> None:
"""Test podman from within the container.
Expand All @@ -47,7 +47,7 @@ def test_podman(exec_container: Callable[[str], subprocess.CompletedProcess[str]
assert result.returncode == 0, "podman command failed"


@pytest.mark.container()
@pytest.mark.container
def test_container_in_container(
exec_container: Callable[[str], subprocess.CompletedProcess[str]],
) -> None:
Expand All @@ -71,7 +71,7 @@ def test_container_in_container(
assert test_path_access.returncode == 0


@pytest.mark.container()
@pytest.mark.container
@pytest.mark.parametrize("app", ("nano", "tar", "vi"))
def test_app(exec_container: Callable[[str], subprocess.CompletedProcess[str]], app: str) -> None:
"""Test the presence of an app in the container.
Expand All @@ -84,7 +84,7 @@ def test_app(exec_container: Callable[[str], subprocess.CompletedProcess[str]],
assert result.returncode == 0, f"{app} command failed"


@pytest.mark.container()
@pytest.mark.container
def test_user_shell(exec_container: Callable[[str], subprocess.CompletedProcess[str]]) -> None:
"""Test the user shell.
Expand All @@ -95,7 +95,7 @@ def test_user_shell(exec_container: Callable[[str], subprocess.CompletedProcess[
assert result.returncode == 0, "zsh not found in /etc/passwd"


@pytest.mark.container()
@pytest.mark.container
def test_navigator_simple_c_in_c(
exec_container: Callable[[str], subprocess.CompletedProcess[str]],
test_fixture_dir_container: Path,
Expand All @@ -120,7 +120,7 @@ def test_navigator_simple_c_in_c(
assert "ok=1" in result.stdout


@pytest.mark.container()
@pytest.mark.container
def test_navigator_simple(
cmd_in_tty: Callable[[str], tuple[str, str, int]],
infrastructure: Infrastructure,
Expand Down Expand Up @@ -152,7 +152,7 @@ def test_navigator_simple(
assert "ok=1" in stdout


@pytest.mark.container()
@pytest.mark.container
@pytest.mark.parametrize("resource", ("playbook", "collection"))
def test_error_container(server_in_container_url: str, resource: str) -> None:
"""Test the error response.
Expand All @@ -164,7 +164,7 @@ def test_error_container(server_in_container_url: str, resource: str) -> None:
tst_error(server_url=server_in_container_url, resource=resource)


@pytest.mark.container()
@pytest.mark.container
def test_collection_v1_container(server_in_container_url: str, tmp_path: Path) -> None:
"""Test the collection creation.
Expand All @@ -175,7 +175,7 @@ def test_collection_v1_container(server_in_container_url: str, tmp_path: Path) -
tst_collection_v1(server_url=server_in_container_url, tmp_path=tmp_path)


@pytest.mark.container()
@pytest.mark.container
def test_playbook_v1_container(server_in_container_url: str, tmp_path: Path) -> None:
"""Test the playbook creation.
Expand All @@ -186,7 +186,7 @@ def test_playbook_v1_container(server_in_container_url: str, tmp_path: Path) ->
tst_playbook_v1(server_url=server_in_container_url, tmp_path=tmp_path)


@pytest.mark.container()
@pytest.mark.container
def test_nav_collections(
container_tmux: ContainerTmux,
tmp_path: Path,
Expand All @@ -211,7 +211,7 @@ def test_nav_collections(
assert any("add_host" in line for line in stdout)


@pytest.mark.container()
@pytest.mark.container
def test_nav_images(
container_tmux: ContainerTmux,
tmp_path: Path,
Expand All @@ -233,7 +233,7 @@ def test_nav_images(
assert any(image in line for line in stdout)


@pytest.mark.container()
@pytest.mark.container
def test_nav_playbook(
container_tmux: ContainerTmux,
tmp_path: Path,
Expand All @@ -259,7 +259,7 @@ def test_nav_playbook(
assert stdout[-1].endswith("Successful")


@pytest.mark.container()
@pytest.mark.container
def test_nav_collection(container_tmux: ContainerTmux, tmp_path: Path) -> None:
"""Test ansible-navigator run using a creator created collection.
Expand All @@ -281,7 +281,7 @@ def test_nav_collection(container_tmux: ContainerTmux, tmp_path: Path) -> None:
assert any(f"{namespace}.{name}" in line for line in stdout)


@pytest.mark.container()
@pytest.mark.container
def test_builder(
exec_container: Callable[[str], subprocess.CompletedProcess[str]],
test_fixture_dir_container: Path,
Expand Down

0 comments on commit b18efe7

Please sign in to comment.