# Path: tests/compat.py
# PY3 = sys.version_info[0] >= 3
# PY33 = sys.version_info >= (3, 3)
# PY34 = sys.version_info >= (3, 4)
# PY35 = sys.version_info >= (3, 5)
# PY36 = sys.version_info >= (3, 6)
# PY27 = sys.version_info >= (2, 7)


import threading
import time
import unittest
import warnings
from ctds.pool import ConnectionPool
from ..compat import mock
        # ... and the connection is not returned to the pool.
        mock_dbapi2.connect.return_value.rollback.side_effect = None

        mock_dbapi2.reset_mock()
        pool.release(pool.acquire())

        mock_dbapi2.assert_has_calls(
            [
                mock.call.connect(),
                mock.call.connect().rollback(),
            ]
        )

    def test_contextmanager(self):
        mock_dbapi2 = mock.MagicMock()
        pool = ConnectionPool(mock_dbapi2, {}, maxsize=10)

        with pool.connection() as connection:
            mock_dbapi2.assert_has_calls(
                [
                    mock.call.connect()
                ]
            )
            self.assertEqual(
                id(connection),
                id(mock_dbapi2.connect.return_value)
            )

        mock_dbapi2.assert_has_calls(
            [

# Path: tests/compat.py
# PY3 = sys.version_info[0] >= 3
# PY33 = sys.version_info >= (3, 3)
# PY34 = sys.version_info >= (3, 4)
# PY35 = sys.version_info >= (3, 5)
# PY36 = sys.version_info >= (3, 6)
# PY27 = sys.version_info >= (2, 7)


# Path: tests/pool/test_pool.py
import threading
import time
import unittest
import warnings
from ctds.pool import ConnectionPool
from ..compat import mock

        # ... and the connection is not returned to the pool.
        mock_dbapi2.connect.return_value.rollback.side_effect = None

        mock_dbapi2.reset_mock()
        pool.release(pool.acquire())

        mock_dbapi2.assert_has_calls(
            [
                mock.call.connect(),
                mock.call.connect().rollback(),
            ]
        )

    def test_contextmanager(self):
        mock_dbapi2 = mock.MagicMock()
        pool = ConnectionPool(mock_dbapi2, {}, maxsize=10)

        with pool.connection() as connection:
            mock_dbapi2.assert_has_calls(
                [
                    mock.call.connect()
                ]
            )
            self.assertEqual(
                id(connection),
                id(mock_dbapi2.connect.return_value)
            )

        mock_dbapi2.assert_has_calls(
            [

                mock.call.connect(),