def test_display_summary(capsys, results_set, swagger_20): # Given the Finished event event = runner.events.Finished.from_results(results=results_set, running_time=1.257) # When `display_summary` is called default.display_summary(event) out = capsys.readouterr().out.strip() # Then number of total tests & total running time should be displayed assert "=== 1 passed in 1.26s ===" in out # And it should be in green & bold style assert strip_style_win32(click.style(click.unstyle(out), fg="green", bold=True)) == out
def test_display_summary(capsys, results_set, swagger_20): # Given the Finished event event = runner.events.Finished(results=results_set, schema=swagger_20, running_time=1.257) # When `display_summary` is called with pytest.raises(click.exceptions.Exit): default.display_summary(event) out = capsys.readouterr().out.strip() # Then number of total tests & total running time should be displayed assert "=== 1 passed in 1.26s ===" in out # And it should be in green & bold style assert click.style(click.unstyle(out), fg="green", bold=True) == out