diff --git a/test/test_array.py b/test/test_array.py
index bca78f5ccbeebf1d86f9ec03a25ded6050bc4097..bfdd10e6981ccf101183201a2ca08ebde0c30cc4 100644
--- a/test/test_array.py
+++ b/test/test_array.py
@@ -37,10 +37,11 @@ import pyopencl.tools as cl_tools
 from pyopencl.tools import (  # noqa
         pytest_generate_tests_for_pyopencl as pytest_generate_tests)
 from pyopencl.characterize import has_double_support, has_struct_arg_count_bug
-from pyopencl.cffi_cl import _PYPY
 
 from pyopencl.clrandom import RanluxGenerator, PhiloxGenerator, ThreefryGenerator
 
+_PYPY = cl._PYPY
+
 
 # {{{ helpers
 
diff --git a/test/test_wrapper.py b/test/test_wrapper.py
index 118eee740c26640c36acd5834842d67c465c54f1..efb860060f696eee8a58ddc282af853ae0f323fd 100644
--- a/test/test_wrapper.py
+++ b/test/test_wrapper.py
@@ -295,7 +295,7 @@ def test_image_format_constructor():
 
     assert iform.channel_order == cl.channel_order.RGBA
     assert iform.channel_data_type == cl.channel_type.FLOAT
-    assert not iform.__dict__
+    assert not hasattr(iform, "__dict__")
 
 
 def test_device_topology_amd_constructor():