[svn r57321] merging the event branch:

* moving in test, misc, code, io directories and
  py/__init__.py
* py/bin/_find.py does not print to stderr anymore
* a few fixes to conftest files in other dirs
some more fixes and adjustments pending

--HG--
branch : trunk
This commit is contained in:
hpk
2008-08-16 17:26:59 +02:00
parent 7428eadf7d
commit abc8cf09aa
187 changed files with 27242 additions and 18 deletions

View File

@@ -0,0 +1,34 @@
import py
from py.__.test.outcome import Failed
from py.__.test.testing.suptest import InlineCollection
def setup_module(mod):
mod.tmp = py.test.ensuretemp(__name__)
class TestDoctests(InlineCollection):
def test_simple_docteststring(self):
txtfile = self.maketxtfile(test_doc="""
>>> i = 0
>>> i + 1
1
""")
config = self.parseconfig(txtfile)
col = config.getfsnode(txtfile)
testitem = col.join(txtfile.basename)
res = testitem.execute()
assert res is None
def test_doctest_unexpected_exception(self):
py.test.skip("implement nice doctest repr for unexpected exceptions")
p = tmp.join("test_doctest_unexpected_exception")
p.write(py.code.Source("""
>>> i = 0
>>> x
2
"""))
testitem = py.test.collect.DoctestFile(p).join(p.basename)
excinfo = py.test.raises(Failed, "testitem.execute()")
repr = testitem.repr_failure(excinfo, ("", ""))
assert repr.reprlocation