Skip to content

Commit 9331ab4

Browse files
api: ConnectionPool support for Python 3.6
After backporting dataclasses, it became possible to use ConnectionPool on Python 3.6. Follows #196
1 parent 976414e commit 9331ab4

File tree

5 files changed

+6
-18
lines changed

5 files changed

+6
-18
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
135135
```
136136

137137
- Support iproto feature discovery (#206).
138+
- Backport ConnectionPool support for Python 3.6.
138139

139140
- Support pandas way to build datetime from timestamp (PR #252).
140141

tarantool/__init__.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
Interval,
4141
)
4242

43+
from tarantool.connection_pool import ConnectionPool, Mode
44+
4345
try:
4446
from tarantool.version import __version__
4547
except ImportError:
@@ -136,9 +138,5 @@ def connectmesh(addrs=({'host': 'localhost', 'port': 3301},), user=None,
136138

137139
__all__ = ['connect', 'Connection', 'connectmesh', 'MeshConnection', 'Schema',
138140
'Error', 'DatabaseError', 'NetworkError', 'NetworkWarning',
139-
'SchemaError', 'dbapi', 'Datetime', 'Interval', 'IntervalAdjust']
140-
141-
# ConnectionPool is supported only for Python 3.7 or newer.
142-
if sys.version_info.major >= 3 and sys.version_info.minor >= 7:
143-
from tarantool.connection_pool import ConnectionPool, Mode
144-
__all__.extend(['ConnectionPool', 'Mode'])
141+
'SchemaError', 'dbapi', 'Datetime', 'Interval', 'IntervalAdjust',
142+
'ConnectionPool', 'Mode']

test/suites/lib/skip.py

-8
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,6 @@ def skip_or_run_varbinary_test(func):
122122
'does not support VARBINARY type')
123123

124124

125-
def skip_or_run_conn_pool_test(func):
126-
"""Decorator to skip or run ConnectionPool tests depending on
127-
the Python version.
128-
"""
129-
130-
return skip_or_run_test_python(func, '3.7',
131-
'does not support ConnectionPool')
132-
133125
def skip_or_run_decimal_test(func):
134126
"""Decorator to skip or run decimal-related tests depending on
135127
the tarantool version.

test/suites/test_pool.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
PoolTolopogyWarning,
1414
)
1515

16-
from .lib.skip import skip_or_run_sql_test, skip_or_run_conn_pool_test
16+
from .lib.skip import skip_or_run_sql_test
1717
from .lib.tarantool_server import TarantoolServer
1818

1919

@@ -75,7 +75,6 @@ def setUpClass(self):
7575
print(' POOL '.center(70, '='), file=sys.stderr)
7676
print('-' * 70, file=sys.stderr)
7777

78-
@skip_or_run_conn_pool_test
7978
def setUp(self):
8079
# Create five servers and extract helpful fields for tests.
8180
self.servers = []

test/suites/test_ssl.py

-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
SSL_TRANSPORT
1111
)
1212
import tarantool
13-
from .lib.skip import skip_or_run_conn_pool_test
1413
from .lib.tarantool_server import TarantoolServer
1514

1615

@@ -291,7 +290,6 @@ def __init__(self,
291290

292291
@unittest.skipIf(sys.platform.startswith("win"),
293292
'Pool tests on windows platform are not supported')
294-
@skip_or_run_conn_pool_test
295293
def test_pool(self):
296294
servers = []
297295
cnt = 5

0 commit comments

Comments
 (0)