Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • gmr/queries
1 result
Show changes
Commits on Source (2)
Loading
Loading
@@ -24,6 +24,7 @@ Example Use:
"""
import logging
import socket
import warnings
 
import psycopg2
from psycopg2 import extras, extensions
Loading
Loading
@@ -237,14 +238,13 @@ class TornadoSession(session.Session):
PostgreSQL. As of ``1.10.3``
 
.. deprecated:: 1.10.3
As of 1.10.3, this method only raises a
:py:exception:`DeprecationWarning`.
As of 1.10.3, this method only warns about Deprecation
 
:rtype: bool
:raises: DeprecationWarning
 
"""
raise DeprecationWarning('All functionality removed from this method')
warnings.warn(
'All functionality removed from this method', DeprecationWarning)
 
def _connect(self):
"""Connect to PostgreSQL, either by reusing a connection from the pool
Loading
Loading
Loading
Loading
@@ -220,17 +220,3 @@ class SessionPublicMethodTests(testing.AsyncTestCase):
obj = tornado_session.TornadoSession(io_loop=self.io_loop)
result = yield obj.query('SELECT 1')
_execute.assert_called_once_with('execute', 'SELECT 1', None)
@testing.gen_test
def test_validate_invokes_connect(self):
with mock.patch('queries.tornado_session.TornadoSession._connect') as \
_connect:
with mock.patch('queries.pool.PoolManager.free'):
future = concurrent.Future()
connection = mock.Mock()
connection.fileno = mock.Mock(return_value=10)
future.set_result(connection)
_connect.return_value = future
obj = tornado_session.TornadoSession(io_loop=self.io_loop)
yield obj.validate()
_connect.assert_called_once_with()