Skip to content

Commit

Permalink
Fix import orders
Browse files Browse the repository at this point in the history
  • Loading branch information
dcermak committed Oct 27, 2023
1 parent e576721 commit 72d0952
Show file tree
Hide file tree
Showing 19 changed files with 43 additions and 49 deletions.
1 change: 0 additions & 1 deletion pytest_container/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

from _pytest.config import Config
from _pytest.mark.structures import ParameterSet

from pytest_container.container import Container
from pytest_container.container import container_from_pytest_param
from pytest_container.container import DerivedContainer
Expand Down
1 change: 0 additions & 1 deletion pytest_container/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
from _pytest.mark.structures import MarkDecorator
from _pytest.mark.structures import ParameterSet
from filelock import FileLock

from pytest_container.inspect import ContainerHealth
from pytest_container.inspect import ContainerInspect
from pytest_container.inspect import PortForwarding
Expand Down
1 change: 0 additions & 1 deletion pytest_container/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from _pytest.config import Config
from _pytest.config.argparsing import Parser
from _pytest.python import Metafunc

from pytest_container.logging import set_internal_logging_level


Expand Down
1 change: 0 additions & 1 deletion pytest_container/pod.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

from _pytest.mark import ParameterSet
from filelock import FileLock

from pytest_container.container import Container
from pytest_container.container import ContainerData
from pytest_container.container import ContainerLauncher
Expand Down
1 change: 0 additions & 1 deletion pytest_container/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import pytest
import testinfra
from _pytest.mark.structures import ParameterSet

from pytest_container.inspect import BindMount
from pytest_container.inspect import Config
from pytest_container.inspect import ContainerHealth
Expand Down
4 changes: 2 additions & 2 deletions tests/test_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
from typing import Union

import pytest

from . import images
from pytest_container import Container
from pytest_container import DerivedContainer
from pytest_container.container import ImageFormat

from . import images


def test_derived_container_fails_without_base() -> None:
"""Ensure that a DerivedContainer cannot be instantiated without providing
Expand Down
12 changes: 6 additions & 6 deletions tests/test_container_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@

import pytest
from pytest import Config

from .images import LEAP
from .images import LEAP_URL
from .images import LEAP_WITH_MAN
from .images import LEAP_WITH_MAN_AND_LUA
from .images import OPENSUSE_BUSYBOX_URL
from pytest_container import Container
from pytest_container import DerivedContainer
from pytest_container import get_extra_build_args
Expand All @@ -19,6 +13,12 @@
from pytest_container.runtime import LOCALHOST
from pytest_container.runtime import OciRuntimeBase

from .images import LEAP
from .images import LEAP_URL
from .images import LEAP_WITH_MAN
from .images import LEAP_WITH_MAN_AND_LUA
from .images import OPENSUSE_BUSYBOX_URL

TAG1 = "local/foobar/bazbarf"


Expand Down
4 changes: 2 additions & 2 deletions tests/test_copy_from_repo.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# pylint: disable=missing-function-docstring,missing-module-docstring
from pytest import Config

from .images import LEAP_URL
from pytest_container import DerivedContainer
from pytest_container.container import ContainerData

from .images import LEAP_URL


LEAP_WITH_CONFIG_FILE = DerivedContainer(
base=LEAP_URL,
Expand Down
3 changes: 2 additions & 1 deletion tests/test_env_variables.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# pylint: disable=missing-function-docstring,missing-module-docstring
from .images import LEAP_URL
from pytest_container.container import Container
from pytest_container.container import ContainerData

from .images import LEAP_URL

ENV = {"SOMETHING": "42", "ANOTHER": "value", "dist": "/bin/dist"}
LEAP_WITH_ENV = Container(
url=LEAP_URL,
Expand Down
6 changes: 3 additions & 3 deletions tests/test_healthcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
from typing import Optional

import pytest

from .images import LEAP
from .images import LEAP_URL
from pytest_container.container import ContainerData
from pytest_container.container import DerivedContainer
from pytest_container.container import ImageFormat
Expand All @@ -15,6 +12,9 @@
from pytest_container.runtime import HealthCheck
from pytest_container.runtime import OciRuntimeBase

from .images import LEAP
from .images import LEAP_URL


CONTAINER_WITH_HEALTHCHECK = DerivedContainer(
base=LEAP_URL,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_inspect.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# pylint: disable=missing-function-docstring,missing-module-docstring
import pytest

from .test_container_build import LEAP
from pytest_container import DerivedContainer
from pytest_container.container import ContainerData
from pytest_container.inspect import VolumeMount
from pytest_container.runtime import OciRuntimeBase

from .test_container_build import LEAP


IMAGE_WITH_EVERYTHING = DerivedContainer(
base=LEAP,
Expand Down
14 changes: 7 additions & 7 deletions tests/test_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@
from typing import Any

import pytest

from .images import CMDLINE_APP_CONTAINER
from .images import CONTAINER_THAT_FAILS_TO_LAUNCH
from .images import LEAP
from .test_volumes import LEAP_WITH_BIND_MOUNT_AND_VOLUME
from .test_volumes import LEAP_WITH_CONTAINER_VOLUMES
from .test_volumes import LEAP_WITH_VOLUMES
from pytest_container import inspect
from pytest_container.container import BindMount
from pytest_container.container import Container
Expand All @@ -25,6 +18,13 @@
from pytest_container.runtime import LOCALHOST
from pytest_container.runtime import OciRuntimeBase

from .images import CMDLINE_APP_CONTAINER
from .images import CONTAINER_THAT_FAILS_TO_LAUNCH
from .images import LEAP
from .test_volumes import LEAP_WITH_BIND_MOUNT_AND_VOLUME
from .test_volumes import LEAP_WITH_CONTAINER_VOLUMES
from .test_volumes import LEAP_WITH_VOLUMES


LEAP_WITH_STOPSIGNAL_SIGKILL = DerivedContainer(
base=LEAP,
Expand Down
6 changes: 3 additions & 3 deletions tests/test_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

from _pytest.config import Config
from filelock import FileLock

from .images import LEAP_URL
from .images import OPENSUSE_BUSYBOX_URL
from pytest_container import Container
from pytest_container import DerivedContainer
from pytest_container.container import ContainerData

from .images import LEAP_URL
from .images import OPENSUSE_BUSYBOX_URL

LEAP_WITH_LOCK = DerivedContainer(
base=OPENSUSE_BUSYBOX_URL,
custom_entry_point="/bin/sh",
Expand Down
16 changes: 8 additions & 8 deletions tests/test_pod.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
from pathlib import Path

import pytest

from .images import BUSYBOX
from .images import CONTAINER_THAT_FAILS_TO_LAUNCH
from .images import LEAP
from .images import LEAP_WITH_MAN
from .images import NGINX_URL
from .images import TEST_POD
from .images import WEB_SERVER
from pytest_container.container import DerivedContainer
from pytest_container.container import ImageFormat
from pytest_container.container import PortForwarding
Expand All @@ -19,6 +11,14 @@
from pytest_container.runtime import OciRuntimeBase
from pytest_container.runtime import PodmanRuntime

from .images import BUSYBOX
from .images import CONTAINER_THAT_FAILS_TO_LAUNCH
from .images import LEAP
from .images import LEAP_WITH_MAN
from .images import NGINX_URL
from .images import TEST_POD
from .images import WEB_SERVER


TEST_POD_WITHOUT_PORTS = Pod(containers=[LEAP, LEAP_WITH_MAN, BUSYBOX])

Expand Down
6 changes: 3 additions & 3 deletions tests/test_port_forwarding.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
from typing import List

import pytest

from .images import NGINX_URL
from .images import WEB_SERVER
from pytest_container.container import ContainerData
from pytest_container.container import DerivedContainer
from pytest_container.container import PortForwarding
from pytest_container.inspect import NetworkProtocol
from pytest_container.runtime import LOCALHOST
from pytest_container.runtime import Version

from .images import NGINX_URL
from .images import WEB_SERVER


def _create_nginx_container(number: int) -> DerivedContainer:
"""Creates a nginx based container which serves
Expand Down
6 changes: 3 additions & 3 deletions tests/test_pytest_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

import pytest
from _pytest.mark import ParameterSet

from .images import LEAP
from .images import TEST_POD
from pytest_container import container_from_pytest_param
from pytest_container import container_to_pytest_param
from pytest_container import DerivedContainer
Expand All @@ -17,6 +14,9 @@
from pytest_container.pod import Pod
from pytest_container.pod import pod_from_pytest_param

from .images import LEAP
from .images import TEST_POD


LEAP_PARAM = pytest.param(LEAP)
LEAP_PARAM_2 = pytest.param(
Expand Down
1 change: 0 additions & 1 deletion tests/test_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from unittest.mock import patch

import pytest

from pytest_container.runtime import DockerRuntime
from pytest_container.runtime import get_selected_runtime
from pytest_container.runtime import OciRuntimeBase
Expand Down
1 change: 0 additions & 1 deletion tests/test_version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Unit tests of the Version class"""
# pylint: disable=missing-function-docstring,missing-module-docstring
import pytest

from pytest_container import Version
from pytest_container.runtime import _get_docker_version
from pytest_container.runtime import _get_podman_version
Expand Down
4 changes: 2 additions & 2 deletions tests/test_volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from typing import List

import pytest

from .images import LEAP_URL
from pytest_container.container import BindMount
from pytest_container.container import BindMountCreator
from pytest_container.container import ContainerData
Expand All @@ -18,6 +16,8 @@
from pytest_container.runtime import LOCALHOST
from pytest_container.runtime import OciRuntimeBase

from .images import LEAP_URL


@pytest.mark.parametrize(
"volume,expected_flag",
Expand Down

0 comments on commit 72d0952

Please sign in to comment.