[Checkins] SVN: gocept.selenium/trunk/ Fixes #7876: Show current test case in command log

Wolfgang Schnerring wosc at wosc.de
Sat Dec 4 12:34:17 EST 2010


Log message for revision 118706:
  Fixes #7876: Show current test case in command log
  
  

Changed:
  U   gocept.selenium/trunk/CHANGES.txt
  U   gocept.selenium/trunk/src/gocept/selenium/base.py

-=-
Modified: gocept.selenium/trunk/CHANGES.txt
===================================================================
--- gocept.selenium/trunk/CHANGES.txt	2010-12-04 10:51:14 UTC (rev 118705)
+++ gocept.selenium/trunk/CHANGES.txt	2010-12-04 17:34:16 UTC (rev 118706)
@@ -4,7 +4,7 @@
 0.9 (unreleased)
 ----------------
 
-- Nothing changed yet.
+- Show current test case in command log (#7876).
 
 
 0.8 (2010-10-22)

Modified: gocept.selenium/trunk/src/gocept/selenium/base.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/base.py	2010-12-04 10:51:14 UTC (rev 118705)
+++ gocept.selenium/trunk/src/gocept/selenium/base.py	2010-12-04 17:34:16 UTC (rev 118706)
@@ -14,8 +14,15 @@
 
 import gocept.selenium.selenese
 import selenium
+import sys
 
 
+if sys.version_info < (2, 5):
+    TEST_METHOD_NAME = '_TestCase__testMethodName'
+else:
+    TEST_METHOD_NAME = '_testMethodName'
+
+
 class Layer(object):
 
     # XXX make configurable:
@@ -56,3 +63,5 @@
         self.layer.switch_db()
         self.selenium = gocept.selenium.selenese.Selenese(
             self.layer.selenium, self)
+        self.selenium.setContext('** %s.%s' % (
+            self.__class__.__name__, getattr(self, TEST_METHOD_NAME)))



More information about the checkins mailing list