diff options
Diffstat (limited to 'tests/test_connection.py')
-rw-r--r-- | tests/test_connection.py | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/tests/test_connection.py b/tests/test_connection.py index fdfafbd..393c20d 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -1,9 +1,7 @@ from redis import Redis -from rq import Connection, Queue, use_connection, get_current_connection, pop_connection -from rq.connections import NoRedisConnectionException - -from tests import find_empty_redis_database, RQTestCase +from rq import Connection, Queue +from tests import RQTestCase, find_empty_redis_database from tests.fixtures import do_nothing @@ -37,30 +35,3 @@ class TestConnectionInheritance(RQTestCase): job2 = q2.enqueue(do_nothing) self.assertEqual(q1.connection, job1.connection) self.assertEqual(q2.connection, job2.connection) - - -class TestConnectionHelpers(RQTestCase): - def test_use_connection(self): - """Test function use_connection works as expected.""" - conn = new_connection() - use_connection(conn) - - self.assertEqual(conn, get_current_connection()) - - use_connection() - - self.assertNotEqual(conn, get_current_connection()) - - use_connection(self.testconn) # Restore RQTestCase connection - - with self.assertRaises(AssertionError): - with Connection(new_connection()): - use_connection() - with Connection(new_connection()): - use_connection() - - def test_resolve_connection_raises_on_no_connection(self): - """Test function resolve_connection raises if there is no connection.""" - pop_connection() - with self.assertRaises(NoRedisConnectionException): - Queue() |