[py-svn] r51157 - in py/branch/event/py/test2: . rsession testing

hpk at codespeak.net hpk at codespeak.net
Thu Jan 31 15:35:53 CET 2008


Author: hpk
Date: Thu Jan 31 15:35:52 2008
New Revision: 51157

Modified:
   py/branch/event/py/test2/repevent.py
   py/branch/event/py/test2/reporter.py
   py/branch/event/py/test2/rsession/rest.py
   py/branch/event/py/test2/rsession/rsession.py
   py/branch/event/py/test2/rsession/web.py
   py/branch/event/py/test2/rsession/webjs.py
   py/branch/event/py/test2/session.py
   py/branch/event/py/test2/testing/test_reporter.py
Log:
some more renaming


Modified: py/branch/event/py/test2/repevent.py
==============================================================================
--- py/branch/event/py/test2/repevent.py	(original)
+++ py/branch/event/py/test2/repevent.py	Thu Jan 31 15:35:52 2008
@@ -49,14 +49,14 @@
         self.host = host
         self.root = root
 
-class TestStarted(ReportEvent):
+class SessionStart(ReportEvent):
     def __init__(self, hosts, config, roots):
         self.hosts = hosts
         self.roots = roots
         self.timestart = time.time()
         self.config = config
 
-class TestFinished(ReportEvent):
+class SessionFinish(ReportEvent):
     def __init__(self):
         self.timeend = time.time()
 

Modified: py/branch/event/py/test2/reporter.py
==============================================================================
--- py/branch/event/py/test2/reporter.py	(original)
+++ py/branch/event/py/test2/reporter.py	Thu Jan 31 15:35:52 2008
@@ -146,7 +146,7 @@
         self.out.line()
         self.repr_failure(event.item, event.outcome)
     
-    def report_TestFinished(self, item):
+    def report_SessionFinish(self, item):
         self.out.line()
         assert hasattr(self, 'timestart')
         self.timeend = item.timeend
@@ -157,8 +157,8 @@
         self.summary()
         return len(self.failed_tests_outcome) > 0
 
-    report_InterruptedExecution = report_TestFinished
-    report_CrashedExecution = report_TestFinished
+    report_InterruptedExecution = report_SessionFinish
+    report_CrashedExecution = report_SessionFinish
 
     def hangs(self):
         h = []

Modified: py/branch/event/py/test2/rsession/rest.py
==============================================================================
--- py/branch/event/py/test2/rsession/rest.py	(original)
+++ py/branch/event/py/test2/rsession/rest.py	Thu Jan 31 15:35:52 2008
@@ -58,7 +58,7 @@
         self.add_rest(Title(txt, abovechar='=', belowchar='='))
         self.timestart = event.timestart
 
-    def report_TestFinished(self, item):
+    def report_TestSessionFinish(self, item):
         self.timeend = item.timeend
         self.summary()
         return len(self.failed_tests_outcome) > 0

Modified: py/branch/event/py/test2/rsession/rsession.py
==============================================================================
--- py/branch/event/py/test2/rsession/rsession.py	(original)
+++ py/branch/event/py/test2/rsession/rsession.py	Thu Jan 31 15:35:52 2008
@@ -44,7 +44,7 @@
         """ main loop for running tests. """
         hm = HostManager(self.config)
         hub = self.config.hub
-        hub.notify(repevent.TestStarted(hm.hosts, self.config, hm.roots))
+        hub.notify(repevent.SessionStart(hm.hosts, self.config, hm.roots))
         try:
             nodes = hm.setup_hosts()
             try:
@@ -59,7 +59,7 @@
 
             print "tearing down nodes"
             hm.teardown_hosts(nodes)
-            hub.notify(repevent.TestFinished())
+            hub.notify(repevent.SessionFinish())
         except (KeyboardInterrupt, SystemExit):
             hub.notify(repevent.InterruptedExecution())
             raise

Modified: py/branch/event/py/test2/rsession/web.py
==============================================================================
--- py/branch/event/py/test2/rsession/web.py	(original)
+++ py/branch/event/py/test2/rsession/web.py	Thu Jan 31 15:35:52 2008
@@ -237,7 +237,7 @@
                 args['hostkey'] = ''
         elif isinstance(event, repevent.ItemStart):
             args = add_item(event)
-        elif isinstance(event, repevent.TestFinished):
+        elif isinstance(event, repevent.TestSessionFinish):
             args = {}
             args['run'] = str(self.all)
             args['fails'] = str(len(self.fail_reasons))
@@ -321,12 +321,12 @@
         self.start_event.set()
         self.pending_events.put(event)
 
-    def report_TestFinished(self, event):
+    def report_TestSessionFinish(self, event):
         self.pending_events.put(event)
         kill_server()
 
-    report_InterruptedExecution = report_TestFinished
-    report_CrashedExecution = report_TestFinished
+    report_InterruptedExecution = report_TestSessionFinish
+    report_CrashedExecution = report_TestSessionFinish
     
     def report(self, what):
         repfun = getattr(self, "report_" + what.__class__.__name__,

Modified: py/branch/event/py/test2/rsession/webjs.py
==============================================================================
--- py/branch/event/py/test2/rsession/webjs.py	(original)
+++ py/branch/event/py/test2/rsession/webjs.py	Thu Jan 31 15:35:52 2008
@@ -199,7 +199,7 @@
             return True
 
         add_received_item_outcome(msg, module_part)
-    elif msg['type'] == 'TestFinished':
+    elif msg['type'] == 'TestSessionFinish':
         text = "FINISHED %s run, %s failures, %s skipped" % (msg['run'], msg['fails'], msg['skips'])
         glob.finished = True
         dom.document.title = "Py.test %s" % text

Modified: py/branch/event/py/test2/session.py
==============================================================================
--- py/branch/event/py/test2/session.py	(original)
+++ py/branch/event/py/test2/session.py	Thu Jan 31 15:35:52 2008
@@ -90,7 +90,7 @@
 
     def header(self, colitems):
         """ setup any neccessary resources ahead of the test run. """
-        self.config.hub.notify(repevent.TestStarted(None, self.config, None))
+        self.config.hub.notify(repevent.SessionStart(None, self.config, None))
         if not self.config.option.nomagic:
             py.magic.invoke(assertion=1)
 
@@ -99,7 +99,7 @@
         py.test2.collect.Function._state.teardown_all()
         if not self.config.option.nomagic:
             py.magic.revoke(assertion=1)
-        self.config.hub.notify(repevent.TestFinished())
+        self.config.hub.notify(repevent.SessionFinish())
     
     def main(self):
         """ main loop for running tests. """

Modified: py/branch/event/py/test2/testing/test_reporter.py
==============================================================================
--- py/branch/event/py/test2/testing/test_reporter.py	(original)
+++ py/branch/event/py/test2/testing/test_reporter.py	Thu Jan 31 15:35:52 2008
@@ -156,7 +156,7 @@
             r.report(repevent.TestStarted(hosts, config, ["a"]))
             r.report(repevent.RsyncFinished())
             list(itemgen(MockSession(r), [rootcol], r.report))
-            r.report(repevent.TestFinished())
+            r.report(repevent.TestSessionFinish())
             return r
         
         cap = py.io.StdCaptureFD()
@@ -178,7 +178,7 @@
         r.report(repevent.RsyncFinished())
         rootcol = py.test2.collect.Directory(tmpdir)
         list(itemgen(MockSession(r), [rootcol], r.report))
-        r.report(repevent.TestFinished())
+        r.report(repevent.TestSessionFinish())
         out, err = cap.reset()
         assert not err
         for i in ['+ testmodule:', 'test_one.py[1]']: # XXX finish



More information about the pytest-commit mailing list