* deprecate py.magic.invoke/revoke in favour of

the new py.code.patch_builtins, py.code.unpatch_builtins

* deprecate py.magic.patch/revert

* deprecate py.magic.AssertionError in favour of py.code._AssertionError

* introduced pytest_assertion plugin.

--HG--
branch : trunk
This commit is contained in:
holger krekel
2009-08-27 17:26:02 +02:00
parent e391662cff
commit 13932b7f4b
26 changed files with 564 additions and 696 deletions

View File

@@ -577,11 +577,11 @@ raise ValueError()
x = 1
assert x == 2
""")
py.magic.invoke(assertion=True)
py.code.patch_builtins(assertion=True)
try:
excinfo = py.test.raises(AssertionError, mod.somefunc)
finally:
py.magic.revoke(assertion=True)
py.code.unpatch_builtins(assertion=True)
p = FormattedExcinfo()
reprentry = p.repr_traceback_entry(excinfo.traceback[-1], excinfo)