Esempio n. 1
0
    def run_suite(self, nose_argv):
        """
        Use Gherkin main program to run Nose.
        """

        result_plugin = ResultPlugin()
        plugins_to_add = [DjangoSetUpPlugin(self),
                          result_plugin,
                          TestReorderer()]

        for plugin in _get_plugins_from_settings():
            plugins_to_add.append(plugin)

        django.setup()

        # Set up Gherkin test subclass
        test_class = getattr(django.conf.settings, 'GHERKIN_TEST_CLASS',
                             'aloe_django.TestCase')
        env = os.environ.copy()
        env['NOSE_GHERKIN_CLASS'] = test_class

        Runner(argv=nose_argv, exit=False,
               addplugins=plugins_to_add,
               env=env)
        return result_plugin.result
Esempio n. 2
0
    def run_suite(self, nose_argv):
        signals.before_suite_run.send(sender=self)
        result_plugin = ResultPlugin()
        plugins_to_add = [DjangoSetUpPlugin(self),
                          result_plugin,
                          TestReorderer()]

        for plugin in _get_plugins_from_settings():
            plugins_to_add.append(plugin)

        cfg_files = all_config_files()
        manager = DefaultPluginManager()
        config = Config(env=os.environ, files=cfg_files, plugins=manager)
        config.plugins.addPlugins(plugins=plugins_to_add)
        text_test_runner = XMLTextNoseTestRunner(config=config, verbosity=self.verbosity)
        nose.core.TestProgram(argv=nose_argv,
                              exit=False,
                              config=config,
                              testRunner=text_test_runner)
        result = result_plugin.result

        if self.with_reports:
            result.dump_xml(self.output_dir)
        signals.after_suite_run.send(sender=self)
        return result
Esempio n. 3
0
    def run_suite(self, nose_argv):
        signals.before_suite_run.send(sender=self)
        result_plugin = ResultPlugin()
        plugins_to_add = [
            DjangoSetUpPlugin(self), result_plugin,
            TestReorderer()
        ]

        for plugin in _get_plugins_from_settings():
            plugins_to_add.append(plugin)

        cfg_files = all_config_files()
        manager = DefaultPluginManager()
        config = Config(env=os.environ, files=cfg_files, plugins=manager)
        config.plugins.addPlugins(extraplugins=plugins_to_add)
        text_test_runner = XMLTextNoseTestRunner(config=config,
                                                 verbosity=self.verbosity)
        nose.core.TestProgram(argv=nose_argv,
                              exit=False,
                              config=config,
                              testRunner=text_test_runner)
        result = result_plugin.result

        if self.with_reports:
            result.dump_xml(self.output_dir)
        signals.after_suite_run.send(sender=self)
        return result
Esempio n. 4
0
    def run_suite(self, nose_argv):
        """
        Use Gherkin main program to run Nose.
        """

        # Django-nose, upon seeing '-n', copies it to nose_argv but not its
        # argument (e.g. -n 1)
        scenario_indices = []
        for i, arg in enumerate(sys.argv):
            if arg == '-n':
                try:
                    scenario_indices.append(sys.argv[i + 1])
                except KeyError:
                    # -n was last? Nose will complain later
                    pass

        # Remove lone '-n'
        nose_argv = [
            arg for arg in nose_argv if arg != '-n'
        ]
        # Put the indices back into nose_argv
        for indices in scenario_indices:
            nose_argv += ['-n', indices]

        result_plugin = ResultPlugin()
        plugins_to_add = [DjangoSetUpPlugin(self),
                          result_plugin,
                          TestReorderer()]

        for plugin in _get_plugins_from_settings():
            plugins_to_add.append(plugin)

        try:
            django.setup()  # pylint:disable=no-member
        except AttributeError:
            # Setup isn't necessary in Django < 1.7
            pass

        # Set up Gherkin test subclass
        test_class = getattr(django.conf.settings, 'GHERKIN_TEST_CLASS',
                             'aloe_django.TestCase')
        env = os.environ.copy()
        env['NOSE_GHERKIN_CLASS'] = test_class

        Runner(argv=nose_argv, exit=False,
               addplugins=plugins_to_add,
               env=env)
        return result_plugin.result
Esempio n. 5
0
    def run_suite(self, nose_argv):
        result_plugin = ResultPlugin()
        plugins_to_add = [GermaniumDjangoSetUpPlugin(self), result_plugin, TestReorderer()]

        for plugin in _get_plugins_from_settings():
            plugins_to_add.append(plugin)

        try:
            django.setup()
        except AttributeError:
            # Setup isn't necessary in Django < 1.7
            pass

        nose.core.TestProgram(argv=nose_argv, exit=False,
                              addplugins=plugins_to_add)
        return result_plugin.result
Esempio n. 6
0
    def run_suite(self, nose_argv):
        # Install necessary plugins
        django_plugin = DjangoPlugin(self)
        result_plugin = ResultPlugin()

        plugins_to_add = [django_plugin, result_plugin]

        for plugin in _get_plugins_from_settings():
            plugins_to_add.append(plugin)

        # Enable tddspry
        nose_argv.append("--with-django")

        # Run nosetests
        nose.core.TestProgram(argv=nose_argv, exit=False, addplugins=plugins_to_add)

        return result_plugin.result
Esempio n. 7
0
    def run_suite(self, nose_argv):
        """Run the test suite."""
        result_plugin = ResultPlugin()
        plugins_to_add = [DjangoSetUpPlugin(self),
                          result_plugin,
                          TestReorderer()]

        for plugin in _get_plugins_from_settings():
            plugins_to_add.append(plugin)
        try:
            django.setup()
        except AttributeError:
            # Setup isn't necessary in Django < 1.7
            pass

        self.test_program(argv=nose_argv, exit=False, addplugins=plugins_to_add, testRunner=DjangoNoseTextTestRunner)
        return result_plugin.result
Esempio n. 8
0
    def run_suite(self, nose_argv):
        """
        Use Gherkin main program to run Nose.
        """

        # Django-nose, upon seeing '-n', copies it to nose_argv but not its
        # argument (e.g. -n 1)
        scenario_indices = []
        for i, arg in enumerate(sys.argv):
            if arg == '-n':
                try:
                    scenario_indices.append(sys.argv[i + 1])
                except KeyError:
                    # -n was last? Nose will complain later
                    pass

        # Remove lone '-n'
        nose_argv = [arg for arg in nose_argv if arg != '-n']
        # Put the indices back into nose_argv
        for indices in scenario_indices:
            nose_argv += ['-n', indices]

        result_plugin = ResultPlugin()
        plugins_to_add = [
            DjangoSetUpPlugin(self), result_plugin,
            TestReorderer()
        ]

        for plugin in _get_plugins_from_settings():
            plugins_to_add.append(plugin)

        try:
            django.setup()  # pylint:disable=no-member
        except AttributeError:
            # Setup isn't necessary in Django < 1.7
            pass

        # Set up Gherkin test subclass
        test_class = getattr(django.conf.settings, 'GHERKIN_TEST_CLASS',
                             'aloe_django.TestCase')
        env = os.environ.copy()
        env['NOSE_GHERKIN_CLASS'] = test_class

        Runner(argv=nose_argv, exit=False, addplugins=plugins_to_add, env=env)
        return result_plugin.result
    def run_suite(self, suite, **kwargs):
        if hasattr(settings, "TEST_RUNNER") and "NoseTestSuiteRunner" in settings.TEST_RUNNER:
            from django_nose.plugin import DjangoSetUpPlugin, ResultPlugin
            from django_nose.runner import _get_plugins_from_settings
            from nose.plugins.manager import PluginManager
            from nose.config import Config
            import nose

            config = Config(plugins=PluginManager())
            config.plugins.loadPlugins()
            result_plugin = ResultPlugin()
            config.plugins.addPlugin(DjangoSetUpPlugin(self))
            config.plugins.addPlugin(result_plugin)
            for plugin in _get_plugins_from_settings():
                config.plugins.addPlugin(plugin)

            nose.core.TestProgram(argv=suite, exit=False, testRunner=TeamcityNoseRunner(config=config))
            return result_plugin.result
        else:
            return TeamcityTestRunner.run(self, suite, **kwargs)
Esempio n. 10
0
  def run_suite(self, suite, **kwargs):
    if _is_nosetest(settings):
      from django_nose.plugin import DjangoSetUpPlugin, ResultPlugin
      from django_nose.runner import _get_plugins_from_settings
      from nose.config import Config
      import nose

      result_plugin = ResultPlugin()
      plugins_to_add = [DjangoSetUpPlugin(self), result_plugin]

      config = Config(plugins=nose.core.DefaultPluginManager())
      config.plugins.addPlugins(extraplugins=plugins_to_add)

      for plugin in _get_plugins_from_settings():
        plugins_to_add.append(plugin)
      nose.core.TestProgram(argv=suite, exit=False, addplugins=plugins_to_add,
                            testRunner=TeamcityNoseRunner(config=config))
      return result_plugin.result

    else:
      self.options.update(kwargs)
      return TeamcityTestRunner.run(self, suite, **self.options)
  def run_suite(self, suite, **kwargs):
    if hasattr(settings, "TEST_RUNNER") and "NoseTestSuiteRunner" in settings.TEST_RUNNER:
      from django_nose.plugin import DjangoSetUpPlugin, ResultPlugin
      from django_nose.runner import _get_plugins_from_settings
      from nose.config import Config
      import nose

      result_plugin = ResultPlugin()
      plugins_to_add = [DjangoSetUpPlugin(self), result_plugin]

      config = Config(plugins=nose.core.DefaultPluginManager())
      config.plugins.addPlugins(extraplugins=plugins_to_add)

      for plugin in _get_plugins_from_settings():
            plugins_to_add.append(plugin)
      nose.core.TestProgram(argv=suite, exit=False, addplugins=plugins_to_add,
        testRunner=TeamcityNoseRunner(config=config)
                              )
      return result_plugin.result

    else:
      return TeamcityTestRunner.run(self, suite, **kwargs)
    def run_suite(self, suite, **kwargs):
        if hasattr(settings, "TEST_RUNNER"
                   ) and "NoseTestSuiteRunner" in settings.TEST_RUNNER:
            from django_nose.plugin import DjangoSetUpPlugin, ResultPlugin
            from django_nose.runner import _get_plugins_from_settings
            from nose.plugins.manager import PluginManager
            from nose.config import Config
            import nose

            config = Config(plugins=PluginManager())
            config.plugins.loadPlugins()
            result_plugin = ResultPlugin()
            config.plugins.addPlugin(DjangoSetUpPlugin(self))
            config.plugins.addPlugin(result_plugin)
            for plugin in _get_plugins_from_settings():
                config.plugins.addPlugin(plugin)

            nose.core.TestProgram(argv=suite,
                                  exit=False,
                                  testRunner=TeamcityNoseRunner(config=config))
            return result_plugin.result
        else:
            return TeamcityTestRunner.run(self, suite, **kwargs)
Esempio n. 13
0
File: runner.py Progetto: pdflu/CPDB
    def run_suite(self, nose_argv):
        """Run the test suite."""
        result_plugin = ResultPlugin()
        plugins_to_add = [
            DjangoSetUpPlugin(self), result_plugin,
            TestReorderer()
        ]

        for plugin in _get_plugins_from_settings():
            plugins_to_add.append(plugin)
        try:
            import django
            django.setup()
        except AttributeError:
            # Setup isn't necessary in Django < 1.7
            pass

        self.test_program(argv=nose_argv,
                          exit=False,
                          addplugins=plugins_to_add,
                          testRunner=DjangoNoseTextTestRunner)
        self.close_browsers()
        return result_plugin.result
    def run_suite(self, suite, **kwargs):
        if hasattr(settings, "TEST_RUNNER"
                   ) and "NoseTestSuiteRunner" in settings.TEST_RUNNER:
            from django_nose.plugin import DjangoSetUpPlugin, ResultPlugin
            from django_nose.runner import _get_plugins_from_settings
            from nose.config import Config
            import nose

            result_plugin = ResultPlugin()
            plugins_to_add = [DjangoSetUpPlugin(self), result_plugin]

            config = Config(plugins=nose.core.DefaultPluginManager())
            config.plugins.addPlugins(extraplugins=plugins_to_add)

            for plugin in _get_plugins_from_settings():
                plugins_to_add.append(plugin)
            nose.core.TestProgram(argv=suite,
                                  exit=False,
                                  addplugins=plugins_to_add,
                                  testRunner=TeamcityNoseRunner(config=config))
            return result_plugin.result

        else:
            return TeamcityTestRunner.run(self, suite, **kwargs)
Esempio n. 15
0
    def run_suite(self, nose_argv):
        """
        Use Gherkin main program to run Nose.
        """

        result_plugin = ResultPlugin()
        plugins_to_add = [
            DjangoSetUpPlugin(self), result_plugin,
            TestReorderer()
        ]

        for plugin in _get_plugins_from_settings():
            plugins_to_add.append(plugin)

        django.setup()

        # Set up Gherkin test subclass
        test_class = getattr(django.conf.settings, 'GHERKIN_TEST_CLASS',
                             'aloe_django.TestCase')
        env = os.environ.copy()
        env['NOSE_GHERKIN_CLASS'] = test_class

        Runner(argv=nose_argv, exit=False, addplugins=plugins_to_add, env=env)
        return result_plugin.result