From: Stefan Behnel Date: Wed, 3 Nov 2010 15:02:12 +0000 (+0100) Subject: removed test from pure.pyx that only works in real pure mode X-Git-Tag: 0.14.alpha0~245 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8a79be0fb85667de65d2ca1d180bb5b375113922;p=cython.git removed test from pure.pyx that only works in real pure mode --- diff --git a/tests/run/pure.pyx b/tests/run/pure.pyx index 26fb3107..4ed263e8 100644 --- a/tests/run/pure.pyx +++ b/tests/run/pure.pyx @@ -70,55 +70,6 @@ def test_locals(x): y = x return y -@cython.test_assert_path_exists("//TryFinallyStatNode", - "//TryFinallyStatNode//GILStatNode") -@cython.test_fail_if_path_exists("//TryFinallyStatNode//TryFinallyStatNode") -def test_with_nogil(nogil): - """ - >>> raised = [] - >>> class nogil(object): - ... def __enter__(self): - ... pass - ... def __exit__(self, exc_class, exc, tb): - ... raised.append(exc) - ... return exc_class is None - - >>> test_with_nogil(nogil()) - WORKS - True - >>> raised - [None] - """ - result = False - with nogil: - print "WORKS" - with cython.nogil: - result = True - return result - -@cython.test_assert_path_exists("//TryFinallyStatNode", - "//TryFinallyStatNode//GILStatNode") -@cython.test_fail_if_path_exists("//TryFinallyStatNode//TryFinallyStatNode") -def test_with_nogil_multiple(nogil): - """ - >>> raised = [] - >>> class nogil(object): - ... def __enter__(self): - ... pass - ... def __exit__(self, exc_class, exc, tb): - ... raised.append(exc) - ... return exc_class is None - - >>> test_with_nogil_multiple(nogil()) - True - >>> raised - [None] - """ - result = False - with nogil, cython.nogil: - result = True - return result - MyUnion = cython.union(n=cython.int, x=cython.double) MyStruct = cython.struct(is_integral=cython.bint, data=MyUnion) MyStruct2 = cython.typedef(MyStruct[2])