[py-svn] r31544 - in py/branch/distributed/py/test/rsession: . testing

hpk at codespeak.net hpk at codespeak.net
Wed Aug 23 15:03:18 CEST 2006


Author: hpk
Date: Wed Aug 23 15:03:15 2006
New Revision: 31544

Added:
   py/branch/distributed/py/test/rsession/report.py
      - copied unchanged from r31542, py/branch/distributed/py/test/rsession/reporter.py
Removed:
   py/branch/distributed/py/test/rsession/reporter.py
Modified:
   py/branch/distributed/py/test/rsession/master.py
   py/branch/distributed/py/test/rsession/outcome.py
   py/branch/distributed/py/test/rsession/testing/test_master.py
Log:
(hpk, fijal) renamiong reporter to report. 


Modified: py/branch/distributed/py/test/rsession/master.py
==============================================================================
--- py/branch/distributed/py/test/rsession/master.py	(original)
+++ py/branch/distributed/py/test/rsession/master.py	Wed Aug 23 15:03:15 2006
@@ -3,7 +3,7 @@
 """
 import py
 from py.__.test.rsession.outcome import ReprOutcome
-from py.__.test.rsession import reporter
+from py.__.test.rsession import report
 
 MAX_TASKS_PER_NODE = 5
 
@@ -18,14 +18,14 @@
         repr_outcome = ReprOutcome(outcomestring)
         item = self.pending.pop()
         # send finish report
-        self.report(reporter.ReceivedItemOutcome(self.channel, item, repr_outcome))
+        self.report(report.ReceivedItemOutcome(self.channel, item, repr_outcome))
 
     def send(self, item):
         self.pending.insert(0, item)
         itemspec = item.listnames()
         self.channel.send(itemspec)
         # send start report
-        self.report(reporter.SendItem(self.channel, item))
+        self.report(report.SendItem(self.channel, item))
 
 def dispatch_loop(masternodes, itemgenerator, shouldstop, 
                   waiter = lambda: py.std.time.sleep(0.1), 

Modified: py/branch/distributed/py/test/rsession/outcome.py
==============================================================================
--- py/branch/distributed/py/test/rsession/outcome.py	(original)
+++ py/branch/distributed/py/test/rsession/outcome.py	Wed Aug 23 15:03:15 2006
@@ -16,6 +16,7 @@
 class ReprOutcome(object):
     def __init__(self, repr_tuple):
         self.passed, self.setupfailure, self.excinfo, self.skipped = repr_tuple
+
     def __repr__(self):
         l = ["%s=%s" %(x, getattr(self, x))
                 for x in "passed skipped setupfailure excinfo".split()]

Deleted: /py/branch/distributed/py/test/rsession/reporter.py
==============================================================================
--- /py/branch/distributed/py/test/rsession/reporter.py	Wed Aug 23 15:03:15 2006
+++ (empty file)
@@ -1,38 +0,0 @@
-
-""" Reporter classes for showing asynchronous and synchronous status events
-"""
-
-import py
-
-def basic_report(msg_type, message):
-    print msg_type, message
-
-#def report(msg_type, message):
-#    pass
-
-def report_error(excinfo):
-    if isinstance(excinfo, py.test.Item.Skipped):
-        # we need to dispatch this info
-        report("skipped", excinfo)
-    else:
-        report("itererror", excinfo)
-
-class ReportEvent(object):
-    def __repr__(self):
-        l = ["%s=%s" %(key, value)
-           for key, value in self.__dict__.items()]
-        return "<%s %s>" %(self.__class__.__name__, " ".join(l),)
-
-class SendItem(ReportEvent):
-    def __init__(self, channel, item):
-        self.item = item
-        self.channel = channel
-
-class ReceivedItemOutcome(ReportEvent):
-    def __init__(self, channel, item, outcome):
-        self.channel = channel
-        self.item = item
-        self.outcome = outcome
-
-# tryiter, main dispatch loop, something else (setup-teardown stuff)
-# 

Modified: py/branch/distributed/py/test/rsession/testing/test_master.py
==============================================================================
--- py/branch/distributed/py/test/rsession/testing/test_master.py	(original)
+++ py/branch/distributed/py/test/rsession/testing/test_master.py	Wed Aug 23 15:03:15 2006
@@ -8,7 +8,7 @@
 from py.__.test.rsession.master import dispatch_loop, setup_slave, MasterNode
 from py.__.test.rsession.outcome import ReprOutcome, Outcome 
 from py.__.test.rsession.testing.test_slave import funcpass_spec, funcfail_spec
-from py.__.test.rsession import reporter
+from py.__.test.rsession import report
 
 def setup_module(mod):
     mod.rootdir = py.path.local(py.__file__).dirpath().dirpath()
@@ -34,7 +34,7 @@
     ch.callback(Outcome(excinfo=42).make_repr())
     assert len(reportlist) == 4
     received = [i for i in reportlist 
-        if isinstance(i, reporter.ReceivedItemOutcome)]
+        if isinstance(i, report.ReceivedItemOutcome)]
     assert received[0].outcome.passed 
     assert not received[1].outcome.passed 
 
@@ -70,8 +70,8 @@
     gw.exit()
 
 def test_slave_running():
-    def simple_reporter(event):
-        if not isinstance(event, reporter.ReceivedItemOutcome):
+    def simple_report(event):
+        if not isinstance(event, report.ReceivedItemOutcome):
             return
         item = event.item
         if item.code.name == 'funcpass':
@@ -82,7 +82,7 @@
     def open_gw():
         gw = py.execnet.PopenGateway()
         channel = setup_slave(gw, rootdir)
-        mn = MasterNode(channel, simple_reporter)
+        mn = MasterNode(channel, simple_report)
         return mn
     
     master_nodes = [open_gw(), open_gw(), open_gw()]



More information about the pytest-commit mailing list