def test_simple_docteststring_failing(): testitem = DoctestText(name="dummy2", parent=None) testitem._setcontent(""" >>> i = 0 >>> i + 1 2 """) py.test.raises(Failed, "testitem.run()")
def test_simple_docteststring(): testitem = DoctestText(name="dummy", parent=None) testitem._setcontent(""" >>> i = 0 >>> i + 1 1 """) res = testitem.run() assert res is None
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