def test_simple(): num_list = [1, 2] observed = mean(num_list) expected = 1.5 assert observed == expected, 'My test failed'
def test_many(num_list, expected_mean): assert mean(num_list) == expected_mean
def test_empty(): with pytest.raises(ZeroDivisionError): mean([])
def test_type_error(): with pytest.raises(TypeError): mean(['a', 'b', 'c', 'd'])
def test_more(num_list): assert mean(num_list) == 3.0