|
3 | 3 | from .helpers.global_data import OsOperations |
4 | 4 | from .helpers.global_data import PortManager |
5 | 5 |
|
6 | | -from ..testgres.node import PgVer |
7 | | -from ..testgres.node import PostgresNode |
8 | | -from ..testgres.utils import get_pg_version2 |
9 | | -from ..testgres.utils import file_tail |
10 | | -from ..testgres.utils import get_bin_path2 |
11 | | -from ..testgres import ProcessType |
12 | | -from ..testgres import NodeStatus |
13 | | -from ..testgres import IsolationLevel |
14 | | - |
15 | | -# New name prevents to collect test-functions in TestgresException and fixes |
16 | | -# the problem with pytest warning. |
17 | | -from ..testgres import TestgresException as testgres_TestgresException |
18 | | - |
19 | | -from ..testgres import InitNodeException |
20 | | -from ..testgres import StartNodeException |
21 | | -from ..testgres import QueryException |
22 | | -from ..testgres import ExecUtilException |
23 | | -from ..testgres import TimeoutException |
24 | | -from ..testgres import InvalidOperationException |
25 | | -from ..testgres import BackupException |
26 | | -from ..testgres import ProgrammingError |
27 | | -from ..testgres import scoped_config |
28 | | -from ..testgres import First, Any |
| 6 | +try: |
| 7 | + # Python 3.8 |
| 8 | + from testgres.node import PgVer |
| 9 | + from testgres.node import PostgresNode |
| 10 | + from testgres.utils import get_pg_version2 |
| 11 | + from testgres.utils import file_tail |
| 12 | + from testgres.utils import get_bin_path2 |
| 13 | + from testgres import ProcessType |
| 14 | + from testgres import NodeStatus |
| 15 | + from testgres import IsolationLevel |
| 16 | + |
| 17 | + # New name prevents to collect test-functions in TestgresException and fixes |
| 18 | + # the problem with pytest warning. |
| 19 | + from testgres import TestgresException as testgres_TestgresException |
| 20 | + |
| 21 | + from testgres import InitNodeException |
| 22 | + from testgres import StartNodeException |
| 23 | + from testgres import QueryException |
| 24 | + from testgres import ExecUtilException |
| 25 | + from testgres import TimeoutException |
| 26 | + from testgres import InvalidOperationException |
| 27 | + from testgres import BackupException |
| 28 | + from testgres import ProgrammingError |
| 29 | + from testgres import scoped_config |
| 30 | + from testgres import First, Any |
| 31 | + |
| 32 | +except ImportError: |
| 33 | + from ..testgres.node import PgVer |
| 34 | + from ..testgres.node import PostgresNode |
| 35 | + from ..testgres.utils import get_pg_version2 |
| 36 | + from ..testgres.utils import file_tail |
| 37 | + from ..testgres.utils import get_bin_path2 |
| 38 | + from ..testgres import ProcessType |
| 39 | + from ..testgres import NodeStatus |
| 40 | + from ..testgres import IsolationLevel |
| 41 | + |
| 42 | + # New name prevents to collect test-functions in TestgresException and fixes |
| 43 | + # the problem with pytest warning. |
| 44 | + from ..testgres import TestgresException as testgres_TestgresException |
| 45 | + |
| 46 | + from ..testgres import InitNodeException |
| 47 | + from ..testgres import StartNodeException |
| 48 | + from ..testgres import QueryException |
| 49 | + from ..testgres import ExecUtilException |
| 50 | + from ..testgres import TimeoutException |
| 51 | + from ..testgres import InvalidOperationException |
| 52 | + from ..testgres import BackupException |
| 53 | + from ..testgres import ProgrammingError |
| 54 | + from ..testgres import scoped_config |
| 55 | + from ..testgres import First, Any |
29 | 56 |
|
30 | 57 | from contextlib import contextmanager |
31 | 58 |
|
|
0 commit comments