mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-27 03:13:43 +03:00
46bf23caf4
* tests/test_dates.py: add tests for date/time typecasting and adaption. * psycopg/adapter_mxdatetime.c (mxdatetime_str): add support for outputting BC dates (which involves switching them to one-based dates). Also remove broken handling of microseconds. * psycopg/typecast.c (typecast_parse_date): if the string ends with "BC" adjust the year value to be a zero-based BC value as used by mx.DateTime (datetime doesn't support BC dates). (typecast_parse_time): ignore ' ', 'B' and 'C' in time strings rather than treating them as part of the seconds part of the time.
28 lines
722 B
Python
Executable File
28 lines
722 B
Python
Executable File
#!/usr/bin/env python
|
|
import os
|
|
import unittest
|
|
|
|
dbname = os.environ.get('PSYCOPG2_TESTDB', 'psycopg2_test')
|
|
|
|
import bugX000
|
|
import extras_dictcursor
|
|
import test_dates
|
|
import test_psycopg2_dbapi20
|
|
import test_quote
|
|
import test_transaction
|
|
import types_basic
|
|
|
|
def test_suite():
|
|
suite = unittest.TestSuite()
|
|
suite.addTest(bugX000.test_suite())
|
|
suite.addTest(extras_dictcursor.test_suite())
|
|
suite.addTest(test_dates.test_suite())
|
|
suite.addTest(test_psycopg2_dbapi20.test_suite())
|
|
suite.addTest(test_quote.test_suite())
|
|
suite.addTest(test_transaction.test_suite())
|
|
suite.addTest(types_basic.test_suite())
|
|
return suite
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main(defaultTest='test_suite')
|