you get "import test" as what it tries to run with
setup.py test
from sqlalchemy.testing import runner
- runner.main()
+ # use this in setup.py 'test_suite':
+ # test_suite="run_tests.setup_py_test"
+ def setup_py_test():
+ runner.setup_py_test()
+
+ if __name__ == '__main__':
+ runner.main()
Where above, the ``registry`` module, introduced in SQLAlchemy 0.8, provides
an in-Python means of installing the dialect entrypoints without the use
state.constraints.append(spec)
else:
pass
-
return state
def _parse_constraints(self, line):
The class being examined by the selector
"""
-
if not issubclass(cls, fixtures.TestBase):
return False
elif cls.__name__.startswith('_'):
def main():
nose.main(addplugins=[NoseSQLAlchemy()])
+
+def setup_py_test():
+ """Runner to use for the 'test_suite' entry of your setup.py.
+
+ Prevents any name clash shenanigans from the command line
+ argument "test" that the "setup.py test" command sends
+ to nose.
+
+ """
+ nose.main(addplugins=[NoseSQLAlchemy()], argv=['runner'])