Пример #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
Пример #3
0
 def join(self, name):
     from py.__.test.doctest import DoctestText
     if name == self.fspath.basename: 
         item = DoctestText(self.fspath.basename, parent=self)
         item._content = self.fspath.read()
         return item