On Monday 21 of March 2016 14:50:29 Pavel Raiskup wrote:
> Hi, thanks for new release!  FWIW, Fedora seems to be fine, too, but let
> me run the testsuite properly.

I enabled the testsuite for regular PyGreSQL builds, testsuite passes:
http://koji.fedoraproject.org/koji/buildinfo?buildID=747307

There is just one issue if I build the PyGreSQL package on my box (CEST
timezone):

    ======================================================================
    FAIL: testDate (tests.test_classic_connection.TestQueryResultTypes)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File 
"/home/praiskup/rh/projects/PyGreSQL/tests/test_classic_connection.py", line 
974, in testDate
        self.assert_proper_cast('1956-01-31 08:42:15+00', 'timestamptz', str)
      File 
"/home/praiskup/rh/projects/PyGreSQL/tests/test_classic_connection.py", line 
932, in assert_proper_cast
        self.assertEqual(r, value)
    AssertionError: '{"1956-01-31 09:42:15+01"}' != '{"1956-01-31 08:42:15+00"}'
    - {"1956-01-31 09:42:15+01"}
    ?               ^        ^
    + {"1956-01-31 08:42:15+00"}
    ?               ^        ^

This can be fixed by:

diff --git a/tests/test_classic_connection.py b/tests/test_classic_connection.py
index de99f43..6d235f1 100755
--- a/tests/test_classic_connection.py
+++ b/tests/test_classic_connection.py
@@ -928,8 +928,9 @@ class TestQueryResultTypes(unittest.TestCase):
         value = '{%s}' % value
         r = self.c.query(q + '[]', (value,)).getresult()[0][0]
         if pgtype.startswith(('date', 'time', 'interval')):
+            r2 = self.c.query(q + '[]', (r,)).getresult()[0][0]
             # arrays of these are casted by the DB wrapper only
-            self.assertEqual(r, value)
+            self.assertEqual(r, r2)
         else:
             self.assertIsInstance(r, list)
             self.assertEqual(len(r), 1)

Thanks, Pavel

_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql

Reply via email to