Skip to content

Commit

Permalink
* runtests.py: add a harness to run all the psycopg tests against
Browse files Browse the repository at this point in the history
	the version built by distutils.
  • Loading branch information
jhenstridge committed Feb 27, 2008
1 parent b5f4a5f commit fc2b684
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2008-02-27 James Henstridge <james@jamesh.id.au>

* runtests.py: add a harness to run all the psycopg tests against
the version built by distutils.

2008-01-22 James Henstridge <james@jamesh.id.au>

* psycopg/typecast.c (typecast_pydatetime): make array static.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ check:
dropdb $(TESTDB) >/dev/null; \
fi
createdb $(TESTDB)
PSYCOPG2_TESTDB=$(TESTDB) $(PYTHON) tests/__init__.py --verbose
PSYCOPG2_TESTDB=$(TESTDB) $(PYTHON) runtests.py --verbose
26 changes: 26 additions & 0 deletions runtests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""A harness to run the psycopg test suite.
If the distutils build directory exists, it will be inserted into the
path so that the tests run against that version of psycopg.
"""

from distutils.util import get_platform
import os
import sys
import unittest

# Insert the distutils build directory into the path, if it exists.
platlib = os.path.join(os.path.dirname(__file__), 'build',
'lib.%s-%s' % (get_platform(), sys.version[0:3]))
if os.path.exists(platlib):
sys.path.insert(0, platlib)

import psycopg2
import tests

def test_suite():
return tests.test_suite()

if __name__ == '__main__':
unittest.main(defaultTest='test_suite')

0 comments on commit fc2b684

Please sign in to comment.