]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Make sqla_nose.py "just work" for running tests on checkouts without a setup.py devel...
authorJason Kirtland <jek@discorporate.us>
Fri, 23 Apr 2010 19:16:58 +0000 (12:16 -0700)
committerJason Kirtland <jek@discorporate.us>
Fri, 23 Apr 2010 19:16:58 +0000 (12:16 -0700)
sqla_nose.py [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 0542b4e..32604f9
@@ -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()])
-