Пример #1
0
    def setUp(self):
        super(SlashRunTest, self).setUp()
        self.generator = TestGenerator()
        (self.success_test, self.fail_test, self.error_test, self.skip_test,
         self.warn_test) = self.generator.generate_tests(5)
        self.generator.make_test_skip(self.skip_test)
        self.generator.make_test_fail(self.fail_test)
        self.generator.make_test_raise_exception(self.error_test)
        self.generator.make_test_warn(self.warn_test)

        self.root_path = self.generator.write_test_directory({
            "success_test.py":
            self.success_test,
            "fail_test.py":
            self.fail_test,
            "error_test.py":
            self.error_test,
            "skip_test.py":
            self.skip_test,
            "warn_test.py":
            self.warn_test,
        })
        self.report_stream = cStringIO()
        self.separator = "-" * 80
        slash.hooks.session_start.register(self._silence_console_logger,
                                           "silence_console")
        self.addCleanup(slash.hooks.session_start.unregister_by_identifier,
                        "silence_console")
Пример #2
0
    def setUp(self):
        super(SlashRunTest, self).setUp()
        self.generator = TestGenerator()
        (self.success_test, self.fail_test,
         self.error_test, self.skip_test, self.warn_test) = self.generator.generate_tests(5)
        self.generator.make_test_skip(self.skip_test)
        self.generator.make_test_fail(self.fail_test)
        self.generator.make_test_raise_exception(self.error_test)
        self.generator.make_test_warn(self.warn_test)

        self.root_path = self.generator.write_test_directory(
            {
                "success_test.py" : self.success_test,
                "fail_test.py" : self.fail_test,
                "error_test.py" : self.error_test,
                "skip_test.py" : self.skip_test,
                "warn_test.py" : self.warn_test,
            }
        )
        self.report_stream = cStringIO()
        self.separator = "-" * 80
        slash.hooks.session_start.register(self._silence_console_logger, "silence_console")
        self.addCleanup(slash.hooks.session_start.unregister_by_identifier, "silence_console")
Пример #3
0
 def setUp(self):
     super(SlashRunSiteCustomizationTest, self).setUp()
     self.forge.replace(slash.site, "load")
     self.forge.replace_with(sys, "stderr", cStringIO())
Пример #4
0
 def setUp(self):
     super(OutputCaptureTest, self).setUp()
     self.stderr = cStringIO()
     self.forge.replace_with(sys, "stderr", self.stderr)
     self.stdout = cStringIO()
     self.forge.replace_with(sys, "stdout", self.stdout)
Пример #5
0
 def setUp(self):
     super(OutputCaptureTest, self).setUp()
     self.stderr = cStringIO()
     self.forge.replace_with(sys, "stderr", self.stderr)
     self.stdout = cStringIO()
     self.forge.replace_with(sys, "stdout", self.stdout)
Пример #6
0
 def setUp(self):
     super(FormatterTest, self).setUp()
     self.buff = cStringIO()
     self.f = Formatter(self.buff)
Пример #7
0
 def setUp(self):
     super(FormatterTest, self).setUp()
     self.buff = cStringIO()
     self.f = Formatter(self.buff)
Пример #8
0
def _console_run(suite):
    suite.disable_debug_info()
    path = suite.commit()
    stream = cStringIO()
    exit_code = slash_run([path], report_stream=stream, working_directory=path)
    return exit_code, stream.getvalue()
Пример #9
0
 def setUp(self):
     super(SlashRunSiteCustomizationTest, self).setUp()
     self.forge.replace(slash.site, "load")
     self.forge.replace_with(sys, "stderr", cStringIO())