Skip to content

Commit

Permalink
Adjust imports to ruff breaking change in 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SRv6d committed Sep 11, 2024
1 parent b1264db commit ebbe862
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 13 deletions.
3 changes: 2 additions & 1 deletion tests/cli/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

import pytest
import structlog
from anycastd._cli.main import app
from click.testing import Result
from typer.testing import CliRunner

from anycastd._cli.main import app


@pytest.fixture
def reset_structlog_config() -> Iterator[None]:
Expand Down
5 changes: 3 additions & 2 deletions tests/cli/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
from pathlib import Path
from unittest.mock import MagicMock

import anycastd
import pytest
import structlog
from anycastd._cli.main import _get_main_configuration
from structlog.testing import capture_logs

import anycastd
from anycastd._cli.main import _get_main_configuration

RE_ISO_TIMESTAMP = (
r"(\d{4})-(\d{2})-(\d{2})" # date
r"T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)((-(\d{2}):(\d{2})|Z)?)" # time
Expand Down
1 change: 1 addition & 0 deletions tests/configuration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pytest
import tomli_w

from anycastd._configuration.healthcheck import CabourotteHealthcheckConfiguration
from anycastd._configuration.main import MainConfiguration, ServiceConfiguration
from anycastd._configuration.prefix import FRRPrefixConfiguration
Expand Down
1 change: 1 addition & 0 deletions tests/configuration/test_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path

import pytest

from anycastd._configuration.conversion import (
_sub_config_to_instance,
dict_w_items_named_by_key_to_flat_w_name_value,
Expand Down
1 change: 1 addition & 0 deletions tests/configuration/test_main_configuration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from anycastd._configuration.exceptions import ConfigurationSyntaxError
from anycastd._configuration.main import MainConfiguration

Expand Down
1 change: 1 addition & 0 deletions tests/configuration/test_reading_configuration_file.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pathlib import Path

import pytest

from anycastd._configuration.exceptions import (
ConfigurationFileUnreadableError,
ConfigurationSyntaxError,
Expand Down
1 change: 1 addition & 0 deletions tests/configuration/test_sub_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from types import ModuleType

import pytest

from anycastd._configuration import healthcheck, prefix
from anycastd._configuration.exceptions import ConfigurationSyntaxError
from anycastd._configuration.healthcheck import CabourotteHealthcheckConfiguration
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import TypeAlias

import pytest

from anycastd.prefix import VRF

_IP_Prefix: TypeAlias = IPv4Network | IPv6Network
Expand Down
5 changes: 3 additions & 2 deletions tests/healthcheck/cabourotte/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

import httpx
import pytest
from pytest_mock import MockerFixture
from structlog.testing import capture_logs

from anycastd.healthcheck._cabourotte.exceptions import CabourotteCheckNotFoundError
from anycastd.healthcheck._cabourotte.main import CabourotteHealthcheck
from anycastd.healthcheck._cabourotte.result import Result
from pytest_mock import MockerFixture
from structlog.testing import capture_logs


def test__init__():
Expand Down
5 changes: 3 additions & 2 deletions tests/healthcheck/cabourotte/test_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
import httpx
import pytest
import respx
from hypothesis import assume, given, strategies
from pytest_mock import MockerFixture

from anycastd.healthcheck._cabourotte.exceptions import (
CabourotteCheckError,
CabourotteCheckNotFoundError,
)
from anycastd.healthcheck._cabourotte.result import Result, get_result
from hypothesis import assume, given, strategies
from pytest_mock import MockerFixture

CABOUROTTE_URL = "http://[::1]:9013"

Expand Down
1 change: 1 addition & 0 deletions tests/healthcheck/test_checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from unittest.mock import AsyncMock

import pytest

from anycastd.healthcheck._common import interval_check


Expand Down
2 changes: 1 addition & 1 deletion tests/prefix/frrouting/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

import pytest
import stamina
from anycastd.prefix import VRF
from testcontainers.core.container import DockerContainer

from anycastd.prefix import VRF
from tests.conftest import _IP_Prefix

FRR_DOCKER_IMAGE = "quay.io/frrouting/frr:{}".format(
Expand Down
2 changes: 1 addition & 1 deletion tests/prefix/frrouting/test_basic_functionality.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from pathlib import Path

import pytest

from anycastd._executor import DockerExecutor
from anycastd.prefix import FRRoutingPrefix

from tests.conftest import skip_without_docker

pytestmark = [pytest.mark.integration, pytest.mark.frrouting_daemon_required]
Expand Down
3 changes: 2 additions & 1 deletion tests/prefix/frrouting/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
from ipaddress import IPv6Network
from pathlib import Path

from structlog.testing import capture_logs

from anycastd._executor import LocalExecutor
from anycastd.prefix._frrouting.exceptions import FRRCommandError
from anycastd.prefix._frrouting.main import FRRoutingPrefix
from structlog.testing import capture_logs


def test_repr(example_networks, example_vrfs):
Expand Down
3 changes: 2 additions & 1 deletion tests/test_entrypoint_version_check.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""Test the Python version check made by the entrypoint."""

import anycastd.__main__
import pytest

import anycastd.__main__

MIN_PYTHON_VERSION = (3, 11)


Expand Down
1 change: 1 addition & 0 deletions tests/test_executor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from anycastd._executor import LocalExecutor

pytestmark = pytest.mark.integration
Expand Down
3 changes: 2 additions & 1 deletion tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import signal

import pytest
from structlog.testing import capture_logs

from anycastd.core._run import run_services, signal_handler
from anycastd.core._service import Service
from structlog.testing import capture_logs


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion tests/test_service.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import asyncio

import pytest
from anycastd.core import Service
from pytest_mock import MockerFixture
from structlog.testing import capture_logs

from anycastd.core import Service
from tests.dummy import DummyHealthcheck, DummyPrefix


Expand Down

0 comments on commit ebbe862

Please sign in to comment.