forked from psycopg/psycopg2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added 'make check' target, running all the available tests.
Most of the updates have been provided by James Henstridge. Closes ticket psycopg#195.
- Loading branch information
Showing
8 changed files
with
92 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
PYTHON = python$(PYTHON_VERSION) | ||
#PYTHON_VERSION = 2.4 | ||
|
||
TESTDB = psycopg2_test | ||
|
||
all: | ||
@: | ||
|
||
check: | ||
@echo "* Creating $(TESTDB)" | ||
@if psql -l | grep -q " $(TESTDB) "; then \ | ||
dropdb $(TESTDB) >/dev/null; \ | ||
fi | ||
createdb $(TESTDB) | ||
PSYCOPG2_TESTDB=$(TESTDB) $(PYTHON) tests/__init__.py --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
#!/usr/bin/env python | ||
import os | ||
import unittest | ||
|
||
dbname = os.environ.get('PSYCOPG2_TESTDB', 'test') | ||
dbname = os.environ.get('PSYCOPG2_TESTDB', 'psycopg2_test') | ||
|
||
import test_psycopg2_dbapi20 | ||
import test_transaction | ||
import types_basic | ||
import extras_dictcursor | ||
|
||
def test_suite(): | ||
suite = unittest.TestSuite() | ||
suite.addTest(test_psycopg2_dbapi20.test_suite()) | ||
suite.addTest(test_transaction.test_suite()) | ||
suite.addTest(types_basic.test_suite()) | ||
suite.addTest(extras_dictcursor.test_suite()) | ||
return suite | ||
import bugX000 | ||
import extras_dictcursor | ||
import test_psycopg2_dbapi20 | ||
import test_quote | ||
import test_transaction | ||
import types_basic | ||
|
||
if __name__ == "__main__": | ||
unittest.main() | ||
def test_suite(): | ||
suite = unittest.TestSuite() | ||
suite.addTest(bugX000.test_suite()) | ||
suite.addTest(extras_dictcursor.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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
#!/usr/bin/env python | ||
import psycopg2 | ||
import time | ||
import unittest | ||
|
||
d1 = psycopg2.Date(2002,12,25) | ||
d2 = psycopg2.DateFromTicks(time.mktime((2002,12,25,0,0,0,0,0,0))) | ||
t1 = psycopg2.Time(13,45,30) | ||
t2 = psycopg2.TimeFromTicks(time.mktime((2001,1,1,13,45,30,0,0,0))) | ||
t1 = psycopg2.Timestamp(2002,12,25,13,45,30) | ||
t2 = psycopg2.TimestampFromTicks( time.mktime((2002,12,25,13,45,30,0,0,0))) | ||
class DateTimeAllocationBugTestCase(unittest.TestCase): | ||
def test_date_time_allocation_bug(self): | ||
d1 = psycopg2.Date(2002,12,25) | ||
d2 = psycopg2.DateFromTicks(time.mktime((2002,12,25,0,0,0,0,0,0))) | ||
t1 = psycopg2.Time(13,45,30) | ||
t2 = psycopg2.TimeFromTicks(time.mktime((2001,1,1,13,45,30,0,0,0))) | ||
t1 = psycopg2.Timestamp(2002,12,25,13,45,30) | ||
t2 = psycopg2.TimestampFromTicks( | ||
time.mktime((2002,12,25,13,45,30,0,0,0))) | ||
|
||
|
||
def test_suite(): | ||
return unittest.TestLoader().loadTestsFromName(__name__) | ||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/usr/bin/env python | ||
import psycopg2 | ||
import psycopg2.extensions | ||
import unittest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/usr/bin/env python | ||
import psycopg2 | ||
import unittest | ||
import tests | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters