Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return 1
if 'running at: {}'.format(local_url) in line:
break
print 'done'
elif endpoint.lower() == 'local':
endpoint = 'http://localhost:8080'
elif endpoint.lower() == 'prod':
endpoint = 'https://url-caster.appspot.com'
elif endpoint.lower() == 'dev':
endpoint = 'https://url-caster-dev.appspot.com'
PwsTest.HOST = endpoint
PwsTest.ENABLE_EXPERIMENTAL = args.experimental
# Run the tests
try:
nose.runmodule()
finally:
# Teardown the endpoint
if server:
os.killpg(os.getpgid(server.pid), signal.SIGINT)
server.wait()
# We should never get here since nose.runmodule will call exit
return 0
@foobar1.method(1)
def foobar1(x):
return "foobar1"
@foobar2.method(2)
def foobar2(x):
return "foobar2"
assert_equal(foobar1(1), "foobar1")
assert_equal(foobar2(2), "foobar2")
if __name__ == '__main__':
import nose
nose.runmodule()
np_inter += inter2
np_union += union2
np_pixAcc = 1.0 * np_correct / (np.spacing(1) + np_label)
np_IoU = 1.0 * np_inter / (np.spacing(1) + np_union)
np_mIoU = np_IoU.mean()
tbar.set_description('pixAcc: %.3f, np_pixAcc: %.3f, mIoU: %.3f, np_mIoU: %.3f'%\
(pixAcc, np_pixAcc, mIoU, np_mIoU))
np.testing.assert_allclose(total_inter, np_inter)
np.testing.assert_allclose(total_union, np_union)
np.testing.assert_allclose(total_correct, np_correct)
np.testing.assert_allclose(total_label, np_label)
if __name__ == '__main__':
import nose
nose.runmodule()
for _suite in suites:
all_tests = itertools.chain(all_tests,
TestLoader().loadTestsFromTestCase(_suite))
suite = nose.suite.ContextSuite(all_tests)
args = [
'', '-v', '-a unit=True', '--with-coverage', '--cover-branches',
'--cover-xml', '--cover-package=dao.RTKHardware',
'--cover-package=dao.RTKDesignElectric',
'--cover-package=dao.RTKDesignMechanic',
'--cover-package=dao.RTKReliability',
'--cover-package=dao.RTKMilHdbkF', '--cover-package=dao.RTKNSWC',
'--cover-package=hardware', '--cover-package=analyses.prediction'
]
nose.runmodule(argv=args, suite=suite, plugins=plugin_mgr)
return None
shape = rand_shape_2d()
data = rand_ndarray(shape, 'csr', density=density)
data_sp = data.asscipy()
result = mx.nd.contrib.getnnz(data, axis=axis)
expected_result = data_sp.getnnz(axis=axis)
assert_almost_equal(result.asnumpy(), expected_result)
densities = [0, 0.5, 1]
axis = [1, None]
for d in densities:
for a in axis:
check_sparse_getnnz(d, a)
if __name__ == '__main__':
import nose
nose.runmodule()
def setUp(self):
self.model = CORE_MODEL
self.model.solver = 'glpk'
@unittest.skipIf(TRAVIS, 'CPLEX not available on Travis.')
class TestSimulationMethodsCPLEX(AbstractTestSimulationMethods, unittest.TestCase):
def setUp(self):
self.model = CORE_MODEL
self.model.solver = 'cplex'
if __name__ == '__main__':
import nose
nose.runmodule()
check_ops = ['add', 'sub', 'mul', 'div']
def make_optestf(op):
def f(self):
self._arith_op_tests(getattr(operator, op))
f.__name__ = 'test_%s' % op
return f
for op in check_ops:
f = make_optestf(op)
setattr(TestSparseVector, f.__name__, f)
del f
if __name__ == '__main__':
import nose
nose.runmodule(argv=[__file__,'-vvs','-x','--pdb', '--pdb-failure'],
exit=False)
import os
@image_comparison(baseline_images=['remove_chartjunk'], extensions=['png'])
def test_remove_chartjunk():
fig, ax = plt.subplots(1)
np.random.seed(14)
ax.bar(np.arange(10), np.abs(np.random.randn(10)), color=set2[0],
edgecolor='white')
remove_chartjunk(ax, ['top', 'right'], grid='y', ticklabels='x')
# fig.savefig('%s/baseline_images/test_remove_chartjunk/remove_chartjunk.png' %
# os.path.dirname(__file__))
if __name__ == '__main__':
import nose
nose.runmodule(argv=['-s', '--with-doctest'])
class TestArgsCompose(TestArgSpecs):
def setUp(self):
super(TestArgsCompose, self).setUp()
def test_concatenate(self):
arg1 = lancet.Args(self.specs1)
arg2 = lancet.Args(self.specs2)
self.assertEqual((arg1 + arg2).specs, self.specs1 + self.specs2)
if __name__ == "__main__":
import sys
import nose
nose.runmodule(argv=[sys.argv[0], "--logging-level", "ERROR"])
module_list : lsit of string
List of modules in package_name ommiting any names in the
exclude list.
"""
pkg = importlib.import_module(package_name)
pkgpath = os.path.dirname(pkg.__file__)
return [name for _, name, _ in pkgutil.iter_modules([pkgpath])
if name not in exclude]
if __name__ == '__main__':
import nose
nose.runmodule(argv=['nose', '--verbosity=3', '--with-doctest'])
# nose.runmodule(argv=['nose', '--verbosity=3'])