def test_not_positive_goal_exception(): with pytest.raises(ValueError): get_number_books_read(0) with pytest.raises(ValueError): get_number_books_read(-1)
def test_past_date_exception(): with pytest.raises(ValueError): get_number_books_read(52, '5-20-2018')
def test_get_number_books_read(goal, date_str, expected): assert get_number_books_read(goal, date_str) == expected