How to use the nose.run 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 owtf / owtf / tests / testing_framework / runner / runner.py View on Github external
def run_nose(self):
        nose.run(argv=shlex.split(self.args))
github ilastik / ilastik / tests / test_lazyflow / test_utility / test_io_util / testTiledVolume.py View on Github external
# requests module logging
    requests_logger = logging.getLogger("requests")
    requests_logger.addHandler(handler)
    requests_logger.setLevel(logging.WARN)

    # tiledVolume logging
    tiledVolumeLogger = logging.getLogger("lazyflow.utility.io_util.tiledVolume")
    tiledVolumeLogger.addHandler(handler)
    tiledVolumeLogger.setLevel(logging.ERROR)

    import sys
    import nose

    sys.argv.append("--nocapture")  # Don't steal stdout.  Show it on the console as usual.
    sys.argv.append("--nologcapture")  # Don't set the logging level to DEBUG.  Leave it alone.
    ret = nose.run(defaultTest=__file__)
    if not ret:
        sys.exit(1)
github ilastik / lazyflow / tests / test_lazyflow / test_operators / test_ioOperators / testOpStreamingUfmfReader.py View on Github external
assert ufmfReader.Output.meta.dtype == EXPECTED_DTYPE
        assert ufmfReader.Output.meta.axistags == vigra.defaultAxistags(EXPECTED_AXIS_ORDER)

        # There was a bug that accidentally caused the same frame to be duplicated
        # across all output frames if you requested more than one frame in a single request.
        # Here, we at least verify that the first frame and the last frame are not identical.
        assert not (output[0] == output[99]).all()

        # Clean reader
        ufmfReader.cleanUp()


if __name__ == "__main__":
    import nose

    ret = nose.run(defaultTest=__file__, env={"NOSE_NOCAPTURE": 1})
    if not ret:
        sys.exit(1)
github yt-project / yt / tests / report_failed_answers.py View on Github external
Returns
    -------
    bool
        True, if all the missing answers are successfully generated
        False, otherwise

    """
    status = True
    test_argv = [os.path.basename(__file__), '--with-answer-testing',
                 '--nologcapture', '-s', '-d', '-v', '--local',
                 '--local-dir=%s' % answer_dir, '--answer-store']

    for job in missing_answers:
        log.info(" Generating answers for " + job)
        status &= nose.run(argv=test_argv+[job], addplugins=[AnswerTesting()],
                           exit=False)
    return status
github ilastik / ilastik / tests / test_lazyflow / test_operators / test_ioOperators / testOpDvidVolume.py View on Github external
expected_data = self.original_data[slicing]

        if transposed_operator:
            expected_data = expected_data.transpose()

        # Compare.
        assert (subvol.view(numpy.ndarray) == expected_data).all(), "Data from server didn't match expected data!"


if __name__ == "__main__":
    import sys
    import nose

    sys.argv.append("--nocapture")  # Don't steal stdout.  Show it on the console as usual.
    sys.argv.append("--nologcapture")  # Don't set the logging level to DEBUG.  Leave it alone.
    nose.run(defaultTest=__file__)
github ilastik / lazyflow / tests / testOpExportSlot.py View on Github external
for fmt in ('jpg', 'png', 'pnm', 'bmp'):
            opExport.OutputFormat.setValue(fmt)
            msg = opExport.FormatSelectionErrorMsg.value
            assert msg, "{} supported although it is actually not".format(fmt)


if __name__ == "__main__":
    import sys
    import nose
    import logging
    handler = logging.StreamHandler( sys.stdout )
    logging.getLogger().addHandler( handler )

    sys.argv.append("--nocapture")    # Don't steal stdout.  Show it on the console as usual.
    sys.argv.append("--nologcapture") # Don't set the logging level to DEBUG.  Leave it alone.
    nose.run(defaultTest=__file__)
github pythononwheels / pow_devel / scripts / runtests.py View on Github external
def runmodels():
    print " -- running model tests"
    testdir = os.path.normpath('./tests/models/')
    configfile = os.path.join(os.path.normpath('./config/'), "nose.cfg")
    argv = [configfile, testdir]
    nose.run(argv=argv)
    return
github wikimedia / analytics-wikimetrics / wikimetrics / run.py View on Github external
def run_test():
    import nose
    nose.run(module='tests')
github nipy / nipy / tools / sneeze.py View on Github external
def run_nose(cover_pkg, test_file, dry_run=False):
    cover_arg = '--cover-package=%s' % cover_pkg
    sys.argv += ['-sv', '--with-coverage', cover_arg]
    # Print out command for user feedback and debugging
    cmd = 'nosetests -sv --with-coverage %s %s' % (cover_arg, test_file)
    print cmd
    if dry_run:
        return cmd
    else:
        print
        nose.run()