How to use the nose.runmodule function in nose

To help you get started, we’ve selected a few nose examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github google / physical-web / web-service / tests.py View on Github external
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
github danwerner / multimethodic / tests.py View on Github external
    @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()
github dmlc / gluon-cv / tests / unittests / test_utils_segmentation.py View on Github external
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()
github ReliaQualAssociates / ramstk / tests / _hardware / TestPackage.py View on Github external
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
github hpi-xnor / BMXNet-v2 / tests / python / unittest / test_sparse_ndarray.py View on Github external
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()
github biosustain / cameo / tests / test_flux_analysis.py View on Github external
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()
github pandas-dev / pandas / pandas / lib / test_sparse.py View on Github external
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)
github olgabot / prettyplotlib / tests / test_remove_chartjunk.py View on Github external
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'])
github ioam / lancet / tests / testargs.py View on Github external
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"])
github rtrwalker / geotecha / geotecha / inputoutput / inputoutput.py View on Github external
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'])