def test(self, verbose=1, extra_argv=None, coverage=False, capture=True,
             knownfailure=True):
        from nose.config import Config
        from nose.plugins.manager import PluginManager
        from numpy.testing.noseclasses import NumpyTestProgram
        # Many Theano tests suppose device=cpu, so we need to raise an
        # error if device==gpu.
        if not os.path.exists('theano/__init__.py'):
            try:
                from theano import config
                if config.device != "cpu":
                    raise ValueError("Theano tests must be run with device=cpu."
                                     " This will also run GPU tests when possible.\n"
                                     " If you want GPU-related tests to run on a"
                                     " specific GPU device, and not the default one,"
                                     " you should use the init_gpu_device theano flag.")
            except ImportError:
                pass

        # cap verbosity at 3 because nose becomes *very* verbose beyond that
        verbose = min(verbose, 3)
        self._show_system_info()

        cwd = os.getcwd()
        if self.package_path in os.listdir(cwd):
            # The tests give weird errors if the package to test is
            # in current directory.
            raise RuntimeError((
                "This function does not run correctly when, at the time "
                "theano was imported, the working directory was theano's "
                "parent directory. You should exit your Python prompt, change "
                "directory, then launch Python again, import theano, then "
                "launch theano.test()."))

        argv, plugins = self.prepare_test_args(verbose, extra_argv, coverage,
                                               capture, knownfailure)

        # The "plugins" keyword of NumpyTestProgram gets ignored if config is
        # specified. Moreover, using "addplugins" instead can lead to strange
        # errors. So, we specify the plugins in the Config as well.
        cfg = Config(includeExe=True, plugins=PluginManager(plugins=plugins))
        t = NumpyTestProgram(argv=argv, exit=False, config=cfg)
        return t.result
Run tests for module using nose.
dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/tests/main.py/TheanoNoseTester.test