Coverage for ejpiaj/runner: 0%

# Coverage for ejpiaj/runner : 0%

## 30 statements 0 run 30 missing 0 excluded

Hot-keys on this page

r m x p toggle line displays

j k next/prev highlighted chunk

0 (zero) top of page

1 (one) first highlighted chunk

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | # -*- coding: utf-8 -*- import logging from clint.textui import puts, colored from .core import test_request def console_runner(suite, variables=None, debug=False, display_variables=False, quiet=False): logger = logging.getLogger(__name__) failed_counter = 0 if not variables: variables = {} if not quiet: puts(colored.white('-' * 80)) puts(colored.white('P - passed assertions, F - failed assertions' ', V - extracted variables')) puts(colored.white('-' * 80)) tests = suite['requests'] for test_name in sorted(suite['requests'].keys()): test = tests[test_name] result = test_request(test, variables) logger.debug(result) if result['valid']: test_name = "%s [P%d,F%d,V%d]" % ( test_name, len(result['passed_assertions']), len(result['failed_assertions']), len(result['variables']), ) if not quiet: line = "✓ " + test_name if display_variables: line += " " + str(result['variables']) puts(colored.green(line)) else: failed_counter += 1 if not quiet: puts(colored.red( "✗ " + test_name + " (" + " ∥ ".join(result['failed_assertions']) + ")" )) if not quiet: puts(colored.white('-' * 80)) return failed_counter