summaryrefslogtreecommitdiff
path: root/tests/testutils.py
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-02-06 18:56:50 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-02-06 21:40:05 +0000
commite599da6308b348fe843c533da97e3d0cc4215952 (patch)
treec3c745d9a1729e48e438b3bc2601aeb395afaaf7 /tests/testutils.py
parentf5cad47909cfdbb1cacdb71ce1f2c62bf1737dfc (diff)
downloadpsycopg2-e599da6308b348fe843c533da97e3d0cc4215952.tar.gz
assertDsnEqual moved as TestSuite method
Diffstat (limited to 'tests/testutils.py')
-rw-r--r--tests/testutils.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/testutils.py b/tests/testutils.py
index f1c93de..b32f6a8 100644
--- a/tests/testutils.py
+++ b/tests/testutils.py
@@ -82,6 +82,13 @@ if (not hasattr(unittest.TestCase, 'assert_')
unittest.TestCase.failUnlessEqual = unittest.TestCase.assertEqual
+def assertDsnEqual(self, dsn1, dsn2, msg=None):
+ """Check that two conninfo string have the same content"""
+ self.assertEqual(set(dsn1.split()), set(dsn2.split()), msg)
+
+unittest.TestCase.assertDsnEqual = assertDsnEqual
+
+
class ConnectingTestCase(unittest.TestCase):
"""A test case providing connections for tests.
@@ -473,7 +480,3 @@ def slow(f):
return self.skipTest("slow test")
return f(self)
return slow_
-
-
-def assertDsnEqual(testsuite, dsn1, dsn2):
- testsuite.assertEqual(set(dsn1.split()), set(dsn2.split()))