예제 #1
0
def test_simple_docteststring_failing():
    testitem = DoctestText(name="dummy2", parent=None)
    testitem._setcontent("""
    >>> i = 0
    >>> i + 1
    2
    """)
    py.test.raises(Failed, "testitem.run()")
예제 #2
0
def test_simple_docteststring():
    testitem = DoctestText(name="dummy", parent=None)
    testitem._setcontent("""
    >>> i = 0
    >>> i + 1
    1
    """)
    res = testitem.run()
    assert res is None