From 41988dfe8609be5e892d3a5d3f94e83db9706454 Mon Sep 17 00:00:00 2001 From: Christine Chen Date: Fri, 9 Apr 2021 18:46:11 -0400 Subject: [PATCH] Fix refactored imports (#9136) * Fix imports * Fix in directory * Fix imports * Postfix test import * Fix style * Fix ON_WINDOWS import --- datadog_checks_dev/datadog_checks/dev/kind.py | 3 ++- datadog_checks_dev/datadog_checks/dev/kube_port_forward.py | 3 ++- directory/tests/test_directory.py | 4 ++-- openldap/tests/conftest.py | 2 +- openstack_controller/tests/conftest.py | 2 +- postfix/tests/conftest.py | 2 +- vault/tests/conftest.py | 4 +++- 7 files changed, 12 insertions(+), 8 deletions(-) diff --git a/datadog_checks_dev/datadog_checks/dev/kind.py b/datadog_checks_dev/datadog_checks/dev/kind.py index 867924e837940..07b938ade2ec5 100644 --- a/datadog_checks_dev/datadog_checks/dev/kind.py +++ b/datadog_checks_dev/datadog_checks/dev/kind.py @@ -7,9 +7,10 @@ from six import PY3 from .env import environment_run +from .fs import create_file, file_exists, path_join from .structures import EnvVars, LazyFunction, TempDir from .subprocess import run_command -from .utils import create_file, file_exists, get_current_check_name, get_tox_env, path_join +from .utils import get_current_check_name, get_tox_env if PY3: from shutil import which diff --git a/datadog_checks_dev/datadog_checks/dev/kube_port_forward.py b/datadog_checks_dev/datadog_checks/dev/kube_port_forward.py index c983bb0de06e1..a013f307a68dc 100644 --- a/datadog_checks_dev/datadog_checks/dev/kube_port_forward.py +++ b/datadog_checks_dev/datadog_checks/dev/kube_port_forward.py @@ -7,9 +7,10 @@ from contextlib import contextmanager from .env import environment_run +from .fs import chdir from .ssh_tunnel import KillProcess, run_background_command from .structures import LazyFunction, TempDir -from .utils import chdir, find_free_port, get_ip +from .utils import find_free_port, get_ip PID_FILE = 'kubectl.pid' diff --git a/directory/tests/test_directory.py b/directory/tests/test_directory.py index 30984fdec57de..dd6fac21d73ed 100644 --- a/directory/tests/test_directory.py +++ b/directory/tests/test_directory.py @@ -10,8 +10,8 @@ import pytest from datadog_checks.base.errors import CheckException, ConfigurationError -from datadog_checks.dev.utils import create_file -from datadog_checks.dev.utils import temp_dir as temp_directory +from datadog_checks.dev.fs import create_file +from datadog_checks.dev.fs import temp_dir as temp_directory from datadog_checks.directory import DirectoryCheck from . import common diff --git a/openldap/tests/conftest.py b/openldap/tests/conftest.py index f4be42d094051..ead2c8cd997d2 100644 --- a/openldap/tests/conftest.py +++ b/openldap/tests/conftest.py @@ -7,7 +7,7 @@ import pytest from datadog_checks.dev import TempDir, docker_run -from datadog_checks.dev.utils import create_file, path_exists +from datadog_checks.dev.fs import create_file, path_exists from datadog_checks.openldap import OpenLDAP from .common import DEFAULT_INSTANCE, HERE, HOST diff --git a/openstack_controller/tests/conftest.py b/openstack_controller/tests/conftest.py index baef3051a4976..20d55987debd1 100644 --- a/openstack_controller/tests/conftest.py +++ b/openstack_controller/tests/conftest.py @@ -6,9 +6,9 @@ import pytest from datadog_checks.base.utils.http import RequestsWrapper +from datadog_checks.dev.fs import get_here from datadog_checks.dev.ssh_tunnel import socks_proxy from datadog_checks.dev.terraform import terraform_run -from datadog_checks.dev.utils import get_here @pytest.fixture(scope='session') diff --git a/postfix/tests/conftest.py b/postfix/tests/conftest.py index c1d1419da2173..80cb9c2d1a57d 100644 --- a/postfix/tests/conftest.py +++ b/postfix/tests/conftest.py @@ -10,7 +10,7 @@ from datadog_checks.base import ensure_unicode from datadog_checks.dev import LazyFunction, TempDir from datadog_checks.dev.env import environment_run, serialize_data, set_env_vars -from datadog_checks.dev.utils import create_file +from datadog_checks.dev.fs import create_file from .common import get_e2e_instance, get_e2e_metadata diff --git a/vault/tests/conftest.py b/vault/tests/conftest.py index d910efd26a367..a8ed65083411d 100644 --- a/vault/tests/conftest.py +++ b/vault/tests/conftest.py @@ -9,8 +9,10 @@ import requests from datadog_checks.dev import LazyFunction, TempDir, docker_run, run_command +from datadog_checks.dev.ci import running_on_ci from datadog_checks.dev.conditions import WaitFor -from datadog_checks.dev.utils import ON_WINDOWS, create_file, running_on_ci +from datadog_checks.dev.fs import create_file +from datadog_checks.dev.utils import ON_WINDOWS from datadog_checks.vault import Vault from .common import COMPOSE_FILE, HEALTH_ENDPOINT, INSTANCES, get_vault_server_config_file