[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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user