From 417203f68eeecd5a460d55e0ed56cd27ad6c290d Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Thu, 17 Nov 2011 21:41:50 +0000 Subject: [PATCH] Added test to check connect() with no parameters --- tests/test_module.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_module.py b/tests/test_module.py index 5d45187a..9c130f3f 100755 --- a/tests/test_module.py +++ b/tests/test_module.py @@ -38,6 +38,13 @@ class ConnectTestCase(unittest.TestCase): def tearDown(self): psycopg2._connect = self._connect_orig + def test_there_has_to_be_something(self): + self.assertRaises(psycopg2.InterfaceError, psycopg2.connect) + self.assertRaises(psycopg2.InterfaceError, psycopg2.connect, + connection_factory=lambda dsn, async=False: None) + self.assertRaises(psycopg2.InterfaceError, psycopg2.connect, + async=True) + def test_no_keywords(self): psycopg2.connect('') self.assertEqual(self.args[0], '')