Skip to content

[FIX] Tests include testgres by right way through import #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import shutil
import pytest

from ...... import testgres
import testgres
from ...pg_probackup2.app import ProbackupApp
from ...pg_probackup2.init_helpers import Init, init_params
from ..storage.fs_backup import FSTestBackupDir
Expand Down
16 changes: 8 additions & 8 deletions tests/helpers/global_data.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from ...testgres.operations.os_ops import OsOperations
from ...testgres.operations.os_ops import ConnectionParams
from ...testgres.operations.local_ops import LocalOperations
from ...testgres.operations.remote_ops import RemoteOperations

from ...testgres.node import PortManager
from ...testgres.node import PortManager__ThisHost
from ...testgres.node import PortManager__Generic
from testgres.operations.os_ops import OsOperations
from testgres.operations.os_ops import ConnectionParams
from testgres.operations.local_ops import LocalOperations
from testgres.operations.remote_ops import RemoteOperations

from testgres.node import PortManager
from testgres.node import PortManager__ThisHost
from testgres.node import PortManager__Generic

import os

Expand Down
10 changes: 5 additions & 5 deletions tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from ..testgres import TestgresConfig
from ..testgres import configure_testgres
from ..testgres import scoped_config
from ..testgres import pop_config
from testgres import TestgresConfig
from testgres import configure_testgres
from testgres import scoped_config
from testgres import pop_config

from .. import testgres
import testgres

import pytest

Expand Down
4 changes: 2 additions & 2 deletions tests/test_os_ops_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import threading
import typing

from ..testgres import InvalidOperationException
from ..testgres import ExecUtilException
from testgres import InvalidOperationException
from testgres import ExecUtilException


class TestOsOpsCommon:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_os_ops_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .helpers.global_data import OsOpsDescrs
from .helpers.global_data import OsOperations

from ..testgres import ExecUtilException
from testgres import ExecUtilException

import os
import pytest
Expand Down
40 changes: 20 additions & 20 deletions tests/test_testgres_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
from .helpers.global_data import OsOperations
from .helpers.global_data import PortManager

from ..testgres.node import PgVer
from ..testgres.node import PostgresNode
from ..testgres.utils import get_pg_version2
from ..testgres.utils import file_tail
from ..testgres.utils import get_bin_path2
from ..testgres import ProcessType
from ..testgres import NodeStatus
from ..testgres import IsolationLevel
from testgres.node import PgVer
from testgres.node import PostgresNode
from testgres.utils import get_pg_version2
from testgres.utils import file_tail
from testgres.utils import get_bin_path2
from testgres import ProcessType
from testgres import NodeStatus
from testgres import IsolationLevel

# New name prevents to collect test-functions in TestgresException and fixes
# the problem with pytest warning.
from ..testgres import TestgresException as testgres_TestgresException

from ..testgres import InitNodeException
from ..testgres import StartNodeException
from ..testgres import QueryException
from ..testgres import ExecUtilException
from ..testgres import TimeoutException
from ..testgres import InvalidOperationException
from ..testgres import BackupException
from ..testgres import ProgrammingError
from ..testgres import scoped_config
from ..testgres import First, Any
from testgres import TestgresException as testgres_TestgresException

from testgres import InitNodeException
from testgres import StartNodeException
from testgres import QueryException
from testgres import ExecUtilException
from testgres import TimeoutException
from testgres import InvalidOperationException
from testgres import BackupException
from testgres import ProgrammingError
from testgres import scoped_config
from testgres import First, Any

from contextlib import contextmanager

Expand Down
24 changes: 12 additions & 12 deletions tests/test_testgres_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
import platform
import logging

from .. import testgres
import testgres

from ..testgres import StartNodeException
from ..testgres import ExecUtilException
from ..testgres import NodeApp
from ..testgres import scoped_config
from ..testgres import get_new_node
from ..testgres import get_bin_path
from ..testgres import get_pg_config
from ..testgres import get_pg_version
from testgres import StartNodeException
from testgres import ExecUtilException
from testgres import NodeApp
from testgres import scoped_config
from testgres import get_new_node
from testgres import get_bin_path
from testgres import get_pg_config
from testgres import get_pg_version

# NOTE: those are ugly imports
from ..testgres.utils import bound_ports
from ..testgres.utils import PgVer
from ..testgres.node import ProcessProxy
from testgres.utils import bound_ports
from testgres.utils import PgVer
from testgres.node import ProcessProxy


def pg_version_ge(version):
Expand Down
14 changes: 7 additions & 7 deletions tests/test_testgres_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
from .helpers.global_data import PostgresNodeService
from .helpers.global_data import PostgresNodeServices

from .. import testgres
import testgres

from ..testgres.exceptions import InitNodeException
from ..testgres.exceptions import ExecUtilException
from testgres.exceptions import InitNodeException
from testgres.exceptions import ExecUtilException

from ..testgres.config import scoped_config
from ..testgres.config import testgres_config
from testgres.config import scoped_config
from testgres.config import testgres_config

from ..testgres import get_bin_path
from ..testgres import get_pg_config
from testgres import get_bin_path
from testgres import get_pg_config

# NOTE: those are ugly imports

Expand Down
6 changes: 3 additions & 3 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from .helpers.global_data import OsOpsDescrs
from .helpers.global_data import OsOperations

from ..testgres.utils import parse_pg_version
from ..testgres.utils import get_pg_config2
from ..testgres import scoped_config
from testgres.utils import parse_pg_version
from testgres.utils import get_pg_config2
from testgres import scoped_config

import pytest
import typing
Expand Down