From 2c78bf5c544b1d7e6e210a6e5685e236126a07b1 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Mon, 8 Aug 2016 15:40:32 -0500 Subject: [PATCH] Accommodate pypy issues in some tests --- test/test_algorithm.py | 8 ++++++++ test/test_wrapper.py | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/test/test_algorithm.py b/test/test_algorithm.py index f41fd824..b1a37fd1 100644 --- a/test/test_algorithm.py +++ b/test/test_algorithm.py @@ -926,6 +926,14 @@ def test_bitonic_sort(ctx_factory, size, dtype): ]) @pytest.mark.bitonic def test_bitonic_argsort(ctx_factory, size, dtype): + import sys + is_pypy = '__pypy__' in sys.builtin_module_names + + if not size and is_pypy: + # https://bitbucket.org/pypy/numpy/issues/53/specifying-strides-on-zero-sized-array + pytest.xfail("pypy doesn't seem to handle as_strided " + "on zero-sized arrays very well") + ctx = cl.create_some_context() queue = cl.CommandQueue(ctx) diff --git a/test/test_wrapper.py b/test/test_wrapper.py index f2b5b645..2bf7d9e8 100644 --- a/test/test_wrapper.py +++ b/test/test_wrapper.py @@ -978,6 +978,9 @@ def test_coarse_grain_svm(ctx_factory): def test_fine_grain_svm(ctx_factory): + import sys + is_pypy = '__pypy__' in sys.builtin_module_names + ctx = ctx_factory() queue = cl.CommandQueue(ctx) @@ -992,7 +995,10 @@ def test_fine_grain_svm(ctx_factory): n = 3000 ary = cl.fsvm_empty(ctx, n, np.float32, alignment=64) - assert isinstance(ary.base, cl.SVMAllocation) + + if not is_pypy: + # https://bitbucket.org/pypy/numpy/issues/52 + assert isinstance(ary.base, cl.SVMAllocation) ary.fill(17) orig_ary = ary.copy() -- GitLab