[py-svn] r62288 - py/trunk/py/test

hpk at codespeak.net hpk at codespeak.net
Sun Mar 1 14:16:16 CET 2009


Author: hpk
Date: Sun Mar  1 14:16:14 2009
New Revision: 62288

Modified:
   py/trunk/py/test/conftesthandle.py
Log:
better error handling


Modified: py/trunk/py/test/conftesthandle.py
==============================================================================
--- py/trunk/py/test/conftesthandle.py	(original)
+++ py/trunk/py/test/conftesthandle.py	Sun Mar  1 14:16:14 2009
@@ -30,12 +30,16 @@
             if anchor.check(): # we found some file object 
                 self._path2confmods[None] = self.getconftestmodules(anchor)
                 break
+        else:
+            assert 0, "no root of filesystem?"
 
     def getconftestmodules(self, path):
         """ return a list of imported conftest modules for the given path.  """ 
         try:
             clist = self._path2confmods[path]
         except KeyError:
+            if path is None:
+                raise ValueError("missing default conftest.")
             dp = path.dirpath()
             if dp == path: 
                 return [self.importconftest(defaultconftestpath)]



More information about the pytest-commit mailing list