diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2017-02-09 11:20:53 +0100 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2017-02-09 16:08:36 +0100 |
commit | 5a3976c43e480b3926691e9f394b8200ca7613f0 (patch) | |
tree | f243f6b966e786468cc22dc545724b9c0b7f39c9 /test/conftest.py | |
parent | f6cea09d5a6a5b63eafaccec9f6100584865999b (diff) | |
download | mitmproxy-5a3976c43e480b3926691e9f394b8200ca7613f0.tar.gz mitmproxy-5a3976c43e480b3926691e9f394b8200ca7613f0.tar.bz2 mitmproxy-5a3976c43e480b3926691e9f394b8200ca7613f0.zip |
coverage whitelist -> blacklist
Diffstat (limited to 'test/conftest.py')
-rw-r--r-- | test/conftest.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/conftest.py b/test/conftest.py index 50ec3421..476b0c20 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -103,7 +103,7 @@ def pytest_runtestloop(session): measured_files = [os.path.normpath(os.path.relpath(f, prefix)) for f in cov.get_data().measured_files()] measured_files = [f for f in measured_files if not any(f.startswith(excluded_f) for excluded_f in excluded_files)] - for name in pytest.config.option.full_cov: + for name in coverage_values.keys(): files = [f for f in measured_files if f.startswith(os.path.normpath(name))] try: with open(os.devnull, 'w') as null: @@ -132,12 +132,12 @@ def pytest_terminal_summary(terminalreporter, exitstatus): msg = "FAIL: Full test coverage not reached!\n" terminalreporter.write(msg, **markup) - for name, value in coverage_values.items(): - if value < 100: + for name in sorted(coverage_values.keys()): + if coverage_values[name] < 100: markup = {'red': True, 'bold': True} else: markup = {'green': True} - msg = 'Coverage for {}: {:.2f}%\n'.format(name, value) + msg = 'Coverage for {}: {:.2f}%\n'.format(name, coverage_values[name]) terminalreporter.write(msg, **markup) else: markup = {'green': True} @@ -146,5 +146,5 @@ def pytest_terminal_summary(terminalreporter, exitstatus): terminalreporter.write(msg, **markup) msg = 'Excluded files:\n' - msg += '{}\n'.format('\n'.join(pytest.config.option.no_full_cov)) + msg += '{}\n'.format('\n'.join(sorted(pytest.config.option.no_full_cov))) terminalreporter.write(msg) |