Skip to content

Commit

Permalink
Address ruff PTH118: part2 (ansible#1802)
Browse files Browse the repository at this point in the history
  • Loading branch information
shatakshiiii authored Jun 15, 2024
1 parent 08cae46 commit 54bebf6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 19 deletions.
8 changes: 2 additions & 6 deletions tests/integration/actions/lint/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@
from collections.abc import Generator


LINT_FIXTURES = os.path.join(
FIXTURES_DIR,
"integration",
"actions",
"lint",
)
# LINT_FIXTURES = f"{FIXTURES_DIR / 'integration' / 'actions' / 'lint'}"
LINT_FIXTURES = FIXTURES_DIR / "integration" / "actions" / "lint"


class BaseClass:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from .base import BaseClass


CLI = Command(subcommand="lint", cmdline=LINT_FIXTURES, execution_environment=True).join()
CLI = Command(subcommand="lint", cmdline=str(LINT_FIXTURES), execution_environment=True).join()

steps: tuple[UiTestStep, ...] = (
UiTestStep(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Tests for lint (with no errors) from CLI, interactive, with an EE."""

import os

import pytest

from tests.integration._interactions import Command
Expand All @@ -15,10 +13,7 @@

CLI = Command(
subcommand="lint",
cmdline=os.path.join(
LINT_FIXTURES,
"no_errors",
),
cmdline=f"{LINT_FIXTURES / 'no_errors'}",
execution_environment=True,
).join()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from .base import BaseClass


CLI = Command(subcommand="lint", cmdline=LINT_FIXTURES, execution_environment=False).join()
CLI = Command(subcommand="lint", cmdline=str(LINT_FIXTURES), execution_environment=False).join()

steps: tuple[UiTestStep, ...] = (
UiTestStep(
Expand Down
8 changes: 3 additions & 5 deletions tests/integration/actions/lint/test_stdout_tmux.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Tests for ``lint`` from CLI, stdout."""

import os

import pytest

from tests.integration._interactions import Command
Expand All @@ -18,8 +16,8 @@
comment="lint stdout with errors",
user_input=Command(
subcommand="lint",
cmdline=LINT_FIXTURES,
precommand=f"cd {os.path.join(LINT_FIXTURES, '..')} ; ",
cmdline=str(LINT_FIXTURES),
precommand=f"cd {LINT_FIXTURES / '..'} ; ",
mode="stdout",
execution_environment=True,
preclear=True,
Expand All @@ -31,7 +29,7 @@
comment="lint stdout with no errors",
user_input=Command(
subcommand="lint",
cmdline=os.path.join(LINT_FIXTURES, "no_errors"),
cmdline=f"{LINT_FIXTURES / 'no_errors'}",
mode="stdout",
execution_environment=True,
).join(),
Expand Down

0 comments on commit 54bebf6

Please sign in to comment.