예제 #1
0
def test_yearly_report_with_invalid_year(df, year):
    msg = f"<ExceptionInfo ValueError('The year {year} is not included in the report!') tblen=2>"
    with pytest.raises(ValueError) as e:
        yearly_report(df, year)
    assert str(e) == msg
예제 #2
0
def test_yearly_report(df, capfd, year, expected):
    yearly_report(df, year)
    output = capfd.readouterr()[0].split("\n")
    assert output[9] == expected