[pypy-dev] [pypy-svn] r33236 - pypy/dist/pypy/objspace/test

Maciek Fijalkowski fijal at genesilico.pl
Thu Oct 12 19:58:29 CEST 2006


auc at codespeak.net wrote:

>Author: auc
>Date: Thu Oct 12 19:24:38 2006
>New Revision: 33236
>
>Modified:
>   pypy/dist/pypy/objspace/test/test_logicobjspace.py
>Log:
>some needed adjustement (most notably, removed explicit scheduling calls)
>
>
>Modified: pypy/dist/pypy/objspace/test/test_logicobjspace.py
>==============================================================================
>--- pypy/dist/pypy/objspace/test/test_logicobjspace.py	(original)
>+++ pypy/dist/pypy/objspace/test/test_logicobjspace.py	Thu Oct 12 19:24:38 2006
>@@ -6,6 +6,11 @@
>     # we might be called from _test_logic_build
>     # if not, check your paths
> 
>+try:
>+    is_interpreted()
>+except:
>+    def is_interpreted(): return True
>+
> 
>  
>
try:
    from pypy.conftest import gettestobjspace
    from py.test import skip
except ImportError:
    pass
    # we might be called from _test_logic_build
    # if not, check your paths

try:
    is_interpreted()
except:
    def is_interpreted(): return True

This is really cool kind of code. If we cannot import pypy, # check your 
paths is in comment (no print, nothing). If we cannot import py.test, we 
probably won't have is_interpreted, so if is_interpreted(): 
py.test.skip("dsa") will just break. And simply calling py.test 
test_logicobjspace.py fails. (It should skip if there are no blablabla 
available).

This attempts of having broken tests makes py.test work harder (because 
I always have to check if tests are broken by default or not).





More information about the Pypy-dev mailing list