[pypy-svn] r17364 - pypy/dist/pypy

arigo at codespeak.net arigo at codespeak.net
Thu Sep 8 14:58:54 CEST 2005


Author: arigo
Date: Thu Sep  8 14:58:53 2005
New Revision: 17364

Modified:
   pypy/dist/pypy/conftest.py
Log:
Don't overwrite a global 'raises' from the conftest, if the module already has
such a name.


Modified: pypy/dist/pypy/conftest.py
==============================================================================
--- pypy/dist/pypy/conftest.py	(original)
+++ pypy/dist/pypy/conftest.py	Thu Sep  8 14:58:53 2005
@@ -98,8 +98,9 @@
         return name.startswith('Test') or name.startswith('AppTest') 
 
     def setup(self): 
-        # stick py.test raise in module globals
-        self.obj.raises = py.test.raises 
+        # stick py.test raise in module globals -- carefully
+        if not hasattr(self.obj, 'raises'):
+            self.obj.raises = py.test.raises 
         super(Module, self).setup() 
         #    if hasattr(mod, 'objspacename'): 
         #        mod.space = getttestobjspace(mod.objspacename)



More information about the Pypy-commit mailing list