diff options
author | Jason Kirtland <jek@discorporate.us> | 2010-04-23 12:16:58 -0700 |
---|---|---|
committer | Jason Kirtland <jek@discorporate.us> | 2010-04-23 12:16:58 -0700 |
commit | dbed163ccebc9c45d9efc2fbb2502ecba4ab8773 (patch) | |
tree | 1729836899cf9cbbd01b9e7ed700d7b89117cdfc /sqla_nose.py | |
parent | 085cb74edfbcfbb95a6c10f702aa717d997ea395 (diff) | |
download | sqlalchemy-dbed163ccebc9c45d9efc2fbb2502ecba4ab8773.tar.gz |
Make sqla_nose.py "just work" for running tests on checkouts without a setup.py develop step or PYTHONPATH.
Diffstat (limited to 'sqla_nose.py')
-rwxr-xr-x[-rw-r--r--] | sqla_nose.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sqla_nose.py b/sqla_nose.py index 0542b4e5d..32604f97c 100644..100755 --- a/sqla_nose.py +++ b/sqla_nose.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python """ nose runner script. @@ -6,17 +7,23 @@ on Python 3K. Otherwise consult README.unittests for the recommended methods of running tests. """ +try: + import sqlalchemy +except ImportError: + from os import path + import sys + sys.path.append(path.join(path.dirname(__file__), 'lib')) import nose from sqlalchemy.test.noseplugin import NoseSQLAlchemy from sqlalchemy.util import py3k + if __name__ == '__main__': if py3k: - # this version breaks verbose output, + # this version breaks verbose output, # but is the only API that nose3 currently supports nose.main(plugins=[NoseSQLAlchemy()]) else: # this is the "correct" API nose.main(addplugins=[NoseSQLAlchemy()]) - |