Exemplo n.º 1
0
def test_error():
    """
    you should get an TypeError if you try to add something other than numbers
    """
    try:
        print cy_add2.add('this', 5)
        assert False  # shouldn't get here!
    except TypeError:
        # should have gotten an exception
        pass
def test_error():
    """
    you should get an TypeError if you try to add something other than numbers
    """
    try:
        print cy_add2.add('this', 5)
        assert False # shouldn't get here!
    except TypeError:
        # should have gotten an exception
        pass
Exemplo n.º 3
0
def test_2():
    assert cy_add2.add(5, 6) == 11
Exemplo n.º 4
0
def test_1():
    assert cy_add2.add(3, 4) == 7
def test_2():
    assert cy_add2.add(5, 6) == 11
def test_1():
    assert cy_add2.add(3, 4) == 7