Example #1
0
def test_mean_wrong_type():
    '''
    Tests the type of the mean fn
    '''
    test_input = "this is not a list, stupid"
    with pytest.raises(TypeError):
        md.mean(test_input)
def test_mean(num_list_and_mean):
    num_list, expected = num_list_and_mean
    print("num_list:", num_list)
    observed = md_uf.mean(num_list)
    print("observed:", observed)
    print("expected:", expected)
    assert observed == expected
Example #3
0
def test_mean():
    # num_list = [1,2,5]
    num_list = [1, 2, 3, 4, 5]
    observed = md_uf.mean(num_list)
    expected = 3

    assert observed == expected
Example #4
0
def test_mean():
    '''
    Tests the mean function
    '''
    num_list = [1, 2, 3, 4, 5]
    observed = md.mean(num_list)
    expected = 3

    assert observed == expected
Example #5
0
def test_many(num_list, expected_mean):
    assert md.mean(num_list) == expected_mean
def test_mean_wrong_type(test_input):
    with pytest.raises(TypeError):
        md_uf.mean(test_input)
Example #7
0
def test_mean_wrong_type():
    test_input = 'this is not a list'

    with pytest.raises(TypeError):
        md_uf.mean(test_input)
Example #8
0
def test_mean():
    num_list = [1, 2, 3, 4, 5]
    obs = md_uf.mean(num_list)
    expected = 3

    assert obs == expected