Add source option to lint command
@@ -72,6 +72,7 @@ def require(where=None):
exit(check_call(cmd, shell=True))
+@manager.arg('source', 's', help='the tests to run', default=None)
@manager.arg('where', 'w', help='test path', default=None)
@manager.arg(
'stop', 'x', help='Stop after first error', type=bool, default=False)
@@ -89,7 +90,7 @@ def require(where=None):
@manager.arg(
'debug', 'D', help='Use nose.loader debugger', type=bool, default=False)
@manager.command
-def test(where=None, stop=None, **kwargs):
+def test(source=None, where=None, stop=None, **kwargs):
"""Run nose, tox, and script tests"""
opts = '-xv' if stop else '-v'
opts += ' --with-coverage' if kwargs.get('cover') else ''
@@ -98,6 +99,7 @@ def test(where=None, stop=None, **kwargs):
opts += ' --detailed-errors' if kwargs.get('verbose') else ''
opts += ' --debug=nose.loader' if kwargs.get('debug') else ''
opts += ' -w {}'.format(where or '')
+ opts += ' {}'.format(source) if source else ''
try:
if kwargs.get('tox'):
@@ -106,6 +108,8 @@ def test(where=None, stop=None, **kwargs):
check_call('detox')
else:
check_call(('nosetests {}'.format(opts)).split(' '))
+
+ if not source:
check_call(['python', p.join(BASEDIR, 'tests', 'test.py')])
except CalledProcessError as e:
exit(e.returncode)
