Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_diff__format_html__with_source_prefix(source1, source2, prefix1, prefix2):
from pycobertura.cli import diff, ExitCodes
runner = CliRunner()
result = runner.invoke(diff, [
'--format', 'html',
'--source1', source1,
'--source2', source2,
'--source-prefix1', prefix1,
'--source-prefix2', prefix2,
'tests/dummy.with-dummy2-better-cov.xml',
'tests/dummy.with-dummy2-better-and-worse.xml',
], catch_exceptions=False)
assert result.output.startswith('')
assert result.output.endswith('\n')
assert result.exit_code == ExitCodes.COVERAGE_WORSENED
def test_exit_codes():
# We shouldn't change exit codes so that clients can rely on them
from pycobertura.cli import ExitCodes
assert ExitCodes.OK == 0
assert ExitCodes.EXCEPTION == 1
assert ExitCodes.COVERAGE_WORSENED == 2
assert ExitCodes.NOT_ALL_CHANGES_COVERED == 3