diff options
| author | Scott Gasch <[email protected]> | 2022-06-03 08:21:52 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2022-06-03 08:21:52 -0700 |
| commit | a1d5f347e978bdb62666a90f55c36047e82ed5cf (patch) | |
| tree | 6d77af4917439e34663fc0f97062e78d294e15fb | |
| parent | 3ca9b4d16433af8da5d2de7f4a2338b56b5428d5 (diff) | |
Add --all and cleanup clear_line().
| -rwxr-xr-x | ansi.py | 5 | ||||
| -rwxr-xr-x | tests/run_tests.py | 14 |
2 files changed, 15 insertions, 4 deletions
@@ -1619,6 +1619,11 @@ def clear_screen() -> str: return "[H[2J" +def clear_line() -> str: + """Clear the current line ANSI escape sequence""" + return "[2K\r" + + def reset() -> str: """Reset text attributes to 'normal'""" return "[m" diff --git a/tests/run_tests.py b/tests/run_tests.py index 6f4b399..fa75539 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -32,6 +32,12 @@ args.add_argument('--unittests', '-u', action='store_true', help='Run unittests. args.add_argument('--doctests', '-d', action='store_true', help='Run doctests.') args.add_argument('--integration', '-i', action='store_true', help='Run integration tests.') args.add_argument( + '--all', + '-a', + action='store_true', + help='Run unittests, doctests and integration tests. Equivalient to -u -d -i', +) +args.add_argument( '--coverage', '-c', action='store_true', help='Run tests and capture code coverage data' ) @@ -347,13 +353,13 @@ def main() -> Optional[int]: logger.debug('Clearing existing coverage data via "coverage erase".') exec_utils.cmd('coverage erase') - if config.config['unittests']: + if config.config['unittests'] or config.config['all']: saw_flag = True threads.append(UnittestTestRunner(params)) - if config.config['doctests']: + if config.config['doctests'] or config.config['all']: saw_flag = True threads.append(DoctestTestRunner(params)) - if config.config['integration']: + if config.config['integration'] or config.config['all']: saw_flag = True threads.append(IntegrationTestRunner(params)) @@ -412,7 +418,7 @@ def main() -> Optional[int]: ) time.sleep(0.5) - print('[2K\rFinal Report:') + print(f'{ansi.clear_line()}Final Report:') if config.config['coverage']: code_coverage_report() total_problems = test_results_report(results) |
