From 04aac83d83e989a4a6e85f27c7dd87d554896f39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A1n=20Ezequiel=20Gallina?= Date: Wed, 30 Apr 2014 16:21:18 -0300 Subject: [PATCH] Cleanup tests imports for patched methods --- django_statsd/tests.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/django_statsd/tests.py b/django_statsd/tests.py index 7ac6d43..f4a8dad 100644 --- a/django_statsd/tests.py +++ b/django_statsd/tests.py @@ -19,6 +19,11 @@ import mock from nose.tools import eq_ from django_statsd.clients import get_client, statsd from django_statsd.patches import utils +from django_statsd.patches.db import ( + patched_callproc, + patched_execute, + patched_executemany, +) from django_statsd import middleware cfg = { @@ -471,7 +476,6 @@ class TestPatchMethod(TestCase): class TestCursorWrapperPatching(TestCase): def test_patched_callproc_calls_timer(self): - from django_statsd.patches.db import patched_callproc with mock.patch.object(statsd, 'timer') as timer: db = mock.Mock(executable_name='name', alias='alias') instance = mock.Mock(db=db) @@ -479,7 +483,6 @@ class TestCursorWrapperPatching(TestCase): self.assertEqual(timer.call_count, 1) def test_patched_execute_calls_timer(self): - from django_statsd.patches.db import patched_execute with mock.patch.object(statsd, 'timer') as timer: db = mock.Mock(executable_name='name', alias='alias') instance = mock.Mock(db=db) @@ -487,7 +490,6 @@ class TestCursorWrapperPatching(TestCase): self.assertEqual(timer.call_count, 1) def test_patched_executemany_calls_timer(self): - from django_statsd.patches.db import patched_executemany with mock.patch.object(statsd, 'timer') as timer: db = mock.Mock(executable_name='name', alias='alias') instance = mock.Mock(db=db)