showing relative paths by default, improving xfail output a bit, bumping version info to 1.0.0

--HG--
branch : 1.0.x
This commit is contained in:
holger krekel
2009-08-03 16:01:32 +02:00
parent 30d77f77af
commit 1a570011fe
10 changed files with 97 additions and 47 deletions

View File

@@ -625,6 +625,27 @@ raise ValueError()
assert tw.lines[9] == ""
assert tw.lines[10].endswith("mod.py:3: ValueError")
def test_toterminal_long_filenames(self):
mod = self.importasmod("""
def f():
raise ValueError()
""")
excinfo = py.test.raises(ValueError, mod.f)
tw = TWMock()
path = py.path.local(mod.__file__)
old = path.dirpath().chdir()
try:
repr = excinfo.getrepr(abspath=False)
repr.toterminal(tw)
line = tw.lines[-1]
assert line == "mod.py:3: ValueError"
repr = excinfo.getrepr(abspath=True)
repr.toterminal(tw)
line = tw.lines[-1]
assert line == "%s:3: ValueError" %(path,)
finally:
old.chdir()
def test_format_excinfo(self):
mod = self.importasmod("""