[svn r63560] beginning to review/polish test events

* pyevent() now receives args and kwargs as simple arguments
* refactoring event handling in tests

--HG--
branch : trunk
This commit is contained in:
hpk
2009-04-03 12:57:34 +02:00
parent 3ab894cadc
commit 54cc936437
11 changed files with 70 additions and 32 deletions

View File

@@ -81,7 +81,9 @@ class ResultLog(object):
shortrepr, longrepr = getoutcomecodes(event)
self.write_log_entry(shortrepr, gpath, longrepr)
def pyevent(self, eventname, event, *args, **kwargs):
def pyevent(self, eventname, args, kwargs):
if args:
event = args[0]
if eventname == "itemtestreport":
self.log_outcome(event)
elif eventname == "collectionreport":
@@ -91,6 +93,7 @@ class ResultLog(object):
path = event.repr.reprcrash.path # fishing :(
self.write_log_entry('!', path, str(event.repr))
# ===============================================================================
#
# plugin tests
@@ -223,7 +226,7 @@ class TestWithFunctionIntegration:
except ValueError:
excinfo = event.InternalException()
reslog = ResultLog(StringIO.StringIO())
reslog.pyevent("internalerror", excinfo)
reslog.pyevent("internalerror", (excinfo,), {})
entry = reslog.logfile.getvalue()
entry_lines = entry.splitlines()