Ejemplo n.º 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()")
Ejemplo n.º 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
Ejemplo n.º 3
0
Archivo: collect.py Proyecto: paskma/py
 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