[py-svn] r57313 - py/branch/event/py/test

hpk at codespeak.net hpk at codespeak.net
Sat Aug 16 15:46:35 CEST 2008


Author: hpk
Date: Sat Aug 16 15:46:33 2008
New Revision: 57313

Modified:
   py/branch/event/py/test/collect.py
Log:
better default reported metainfo


Modified: py/branch/event/py/test/collect.py
==============================================================================
--- py/branch/event/py/test/collect.py	(original)
+++ py/branch/event/py/test/collect.py	Sat Aug 16 15:46:33 2008
@@ -383,8 +383,11 @@
         return basic_run_report
 
     def repr_metainfo(self):
-        code = py.code.Code(self.execute)
-        return self.ReprMetaInfo(code.path, code.firstlineno)
+        try:
+            return self.ReprMetaInfo(self.fspath, modpath=self.__class__.__name__)
+        except AttributeError:
+            code = py.code.Code(self.execute)
+            return self.ReprMetaInfo(code.path, code.firstlineno)
       
     def execute(self):
         """ execute this test item."""



More information about the pytest-commit mailing list