def test_lib(options): """ Run tests for common/lib/ and pavelib/ (paver-tests) """ lib = getattr(options, 'lib', None) test_id = getattr(options, 'test_id', lib) opts = { 'failed_only': getattr(options, 'failed', None), 'fail_fast': getattr(options, 'fail_fast', None), 'verbosity': getattr(options, 'verbosity', 1), } if test_id: if '/' in test_id: lib = '/'.join(test_id.split('/')[0:3]) else: lib = 'common/lib/' + test_id.split('.')[0] opts['test_id'] = test_id lib_tests = [suites.LibTestSuite(lib, **opts)] else: lib_tests = [suites.LibTestSuite(d, **opts) for d in Env.LIB_TEST_DIRS] test_suite = suites.PythonTestSuite('python tests', subsuites=lib_tests, **opts) test_suite.run()
def test_lib(options, passthrough_options): """ Run tests for common/lib/ and pavelib/ (paver-tests) """ lib = getattr(options, 'lib', None) test_id = getattr(options, 'test_id', lib) if test_id: if '/' in test_id: lib = '/'.join(test_id.split('/')[0:3]) else: lib = 'common/lib/' + test_id.split('.')[0] options.test_lib['test_id'] = test_id lib_tests = [ suites.LibTestSuite(lib, passthrough_options=passthrough_options, **options.test_lib) ] else: lib_tests = [ suites.LibTestSuite(d, passthrough_options=passthrough_options, **options.test_lib) for d in Env.LIB_TEST_DIRS ] test_suite = suites.PythonTestSuite( 'python tests', subsuites=lib_tests, passthrough_options=passthrough_options, **options.test_lib) test_suite.run()
def test_lib(options): """ Run tests for common/lib/ and pavelib/ (paver-tests) """ lib = getattr(options, 'lib', None) test_id = getattr(options, 'test_id', lib) opts = { 'failed_only': getattr(options, 'failed', None), 'fail_fast': getattr(options, 'fail_fast', None), 'verbosity': getattr(options, 'verbosity', 1), 'extra_args': getattr(options, 'extra_args', ''), 'cov_args': getattr(options, 'cov_args', ''), } if test_id: if '/' in test_id: lib = '/'.join(test_id.split('/')[0:3]) else: lib = 'common/lib/' + test_id.split('.')[0] opts['test_id'] = test_id lib_tests = [suites.LibTestSuite(lib, **opts)] else: lib_tests = [suites.LibTestSuite(d, **opts) for d in Env.LIB_TEST_DIRS] test_suite = suites.PythonTestSuite('python tests', subsuites=lib_tests, **opts) test_suite.run() # Clear the Esperanto directory of any test artifacts sh('git checkout conf/locale/eo')
def test_lib(options, passthrough_options): """ Run tests for common/lib/ and pavelib/ (paver-tests) """ lib = getattr(options, 'lib', None) test_id = getattr(options, 'test_id', lib) django_version = getattr(options, 'django_version', None) assert django_version in (None, '1.8', '1.9', '1.10', '1.11') if test_id: # Testing a single test id. if '/' in test_id: lib = '/'.join(test_id.split('/')[0:3]) else: lib = 'common/lib/' + test_id.split('.')[0] options.test_lib['test_id'] = test_id lib_tests = [suites.LibTestSuite( lib, passthrough_options=passthrough_options, **options.test_lib )] else: # Testing all common/lib test dirs - plus pavelib. lib_tests = [ suites.LibTestSuite( d, passthrough_options=passthrough_options, append_coverage=(i != 0), **options.test_lib ) for i, d in enumerate(Env.LIB_TEST_DIRS) ] test_suite = suites.PythonTestSuite( 'python tests', subsuites=lib_tests, passthrough_options=passthrough_options, **options.test_lib ) test_suite.run()