Register that a test that was skipped.

        Parameters
        ----------
        test : unittest.TestCase
            The test that has completed.
        reason : str
            The reason the test was skipped.
779229
def addSkip(self, test, reason):
        
        result = self._handle_result(
            test, TestCompletionStatus.skipped, message=reason)
        self.skipped.append(result)
1123395
def jira(test_key):
    

    def decorator(test_item):
        def modified_test(*args, **kwargs):
            save_jira_conf()
            try:
                test_item(*args, **kwargs)
            except Exception as e:
                error_message = get_error_message_from_exception(e)
                test_comment = "The test '{}' has failed: {}".format(args[0].get_method_name(), error_message)
                add_jira_status(test_key, 'Fail', test_comment)
                raise
            add_jira_status(test_key, 'Pass', None)

        modified_test.__name__ = test_item.__name__
        return modified_test

    return decorator
73926
def __add_delayed_assert_failure(self):
        
        current_url = self.driver.current_url
        message = self.__get_exception_message()
        self.__delayed_assert_failures.append(
            "CHECK #%s: (%s)\n %s" % (
                self.__delayed_assert_count, current_url, message))
320591
def run(self, test):
        ""
        # These parts of Nose's pluggability are baked into
        # nose.core.TextTestRunner. Reproduce them:
        wrapper = self.config.plugins.prepareTest(test)
        if wrapper is not None:
            test = wrapper
        wrapped = self.config.plugins.setOutputStream(self.stream)
        if wrapped is not None:
            self.stream = wrapped

        result = self._makeResult()
        startTime = time()
        try:
            test(result)
        except KeyboardInterrupt:
            # we need to ignore these exception to not
            # show traceback when user intentionally
            # interrupted test suite execution, and
            # to output some reasonable results on
            # already passed and failed tests.
            pass
        stopTime = time()

        # We don't care to hear about errors again at the end; we take care of
        # that in result.addError(), while the tests run.
        # result.printErrors()
        #
        # However, we do need to call this one useful line from
        # nose.result.TextTestResult's implementation of printErrors() to make
        # sure other plugins get a chance to report:
        self.config.plugins.report(self.stream)

        result.printSummary(startTime, stopTime)
        self.config.plugins.finalize(result)
        return result
805524
def trial(path=TESTS_PATH, coverage=False):
    
    args = ['trial']
    if coverage:
        args.append('--coverage')
    args.append(path)
    print args
    local(' '.join(args))
80714
def report(test)
      case test.result
      when :success
        if @type == :test
          print_test_success(test)
        else
          print_generate_success(test)
        end
        @success += 1

      when :skipped
        if @type == :test
          print_test_skipped(test)
        else
          print_generate_skipped(test)
        end
        @skipped += 1

      # Generate can't fail directly
      when :failed
        print_test_failed(test)
        @failed += 1

      when :timedout
        if @type == :test
          print_test_timeout(test)
        else
          print_generate_timeout(test)
        end
        @failed += 1
      end
    end
839247
def guard(ctx, opts=""):
    
    # TODO if coverage was run via pytest-cov, we could add coverage here too
    return test(ctx, include_slow=True, loop_on_fail=True, opts=opts)
462139
def _printTraceback(self, test, err):
        
        # Don't bind third item to a local var; that can create
        # circular refs which are expensive to collect. See the
        # sys.exc_info() docs.
        exception_type, exception_value = err[:2]
        # TODO: In Python 3, the traceback is attached to the exception
        # instance through the __traceback__ attribute. If the instance
        # is saved in a local variable that persists outside the except
        # block, the traceback will create a reference cycle with the
        # current frame and its dictionary of local variables. This will
        # delay reclaiming dead resources until the next cyclic garbage
        # collection pass.

        extracted_tb = extract_relevant_tb(
            err[2],
            exception_type,
            exception_type is test.failureException)
        test_frame_index = index_of_test_frame(
            extracted_tb,
            exception_type,
            exception_value,
            test)
        if test_frame_index:
            # We have a good guess at which frame is the test, so
            # trim everything until that. We don't care to see test
            # framework frames.
            extracted_tb = extracted_tb[test_frame_index:]

        with self.bar.dodging():
            self.stream.write(''.join(
                format_traceback(
                    extracted_tb,
                    exception_type,
                    exception_value,
                    self._cwd,
                    self._term,
                    self._options.function_color,
                    self._options.dim_color,
                    self._options.editor,
                    self._options.editor_shortcut_template)))
171568
def execute(self,
                container: Container,
                test: TestCase,
                verbose: bool = False
                ) -> TestOutcome:
        
        bug = self.__installation.bugs[container.bug]  # type: Bug
        response = self.command(container,
                                cmd=test.command,
                                context=test.context,
                                stderr=True,
                                time_limit=test.time_limit,
                                kill_after=test.kill_after,
                                verbose=verbose)
        passed = test.oracle.check(response)
        return TestOutcome(response, passed)
1157972
def addSuccess(self, test, capt=None):
        """"""
        time_taken = self._register_time(test, 'success')
        if self.timer_fail is not None and time_taken * 1000.0 > self.threshold:
            test.fail('Test was too slow (took {0:0.4f}s, threshold was '
                      '{1:0.4f}s)'.format(time_taken, self.threshold / 1000.0))
75624
def addUnexpectedSuccess(self, test):
        
        result = self._handle_result(
            test, TestCompletionStatus.unexpected_success)
        self.unexpectedSuccesses.append(result)
459180
function(test) {
			var context = this.loopContext;
			var forkContext = this.forkContext;
			var testSegments = forkContext.makeNext(0, -1);

			// Update state.
			context.test = test;
			context.continueDestSegments = testSegments;
			forkContext.replaceHead(testSegments);
		}
326536
function (test) {
        if (test.callback) {
            test.callback.fn.apply(test.callback.scope, test.callback.args);
        }
    }
542778
public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time)
    {
        if (!$this->colors) {
            parent::addError($test, $e, $time);

            return;
        }

        $this->writeProgress(Coloring::magenta('E'));
        $this->lastTestFailed = true;
    }
1234841
def addError(self, test: unittest.case.TestCase, exc_info: tuple) -> None:
        
        # noinspection PyTypeChecker
        self.add_result(TestState.error, test, exc_info)
653794
def instances(self, skip_exist_test=False):
        
        self.reset_result_type()
        self._instances = True
        self._instances_skip_exist_test = skip_exist_test
        return self
862309
function(test) {
			var context = this.loopContext;
			var forkContext = this.forkContext;

			context.test = test;

			// Creates paths of `continue` statements.
			if (!context.continueForkContext.empty) {
				context.continueForkContext.add(forkContext.head);
				var testSegments = context.continueForkContext.makeNext(0, -1);

				forkContext.replaceHead(testSegments);
			}
		}