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_test_results_default_path(cli_runner):
"""Check if test results in the default path works."""
with cli_runner.isolated_filesystem():
with open('junit-results.xml', 'w') as handler:
handler.write(JUNIT_XML)
result = cli_runner.invoke(cli, ['test-results'])
assert result.exit_code == 0
assert 'Error: 1\n' in result.output
assert 'Failure: 1\n' in result.output
assert 'Passed: 4\n' in result.output
assert 'Skipped: 1\n' in result.output
def test_test_results(cli_runner):
"""Check if test results command works."""
with cli_runner.isolated_filesystem():
with open('results.xml', 'w') as handler:
handler.write(JUNIT_XML)
result = cli_runner.invoke(
cli, ['test-results', '--path', 'results.xml'])
assert result.exit_code == 0
assert 'Error: 1\n' in result.output
assert 'Failure: 1\n' in result.output
assert 'Passed: 4\n' in result.output
assert 'Skipped: 1\n' in result.output