diff --git a/test/test_wrapper.py b/test/test_wrapper.py
index 758b05c0a5ca69b60ea4a436d1d214e7f2e7dd60..c0ecdcaace8e3b313939905783bc0753eb26d06f 100644
--- a/test/test_wrapper.py
+++ b/test/test_wrapper.py
@@ -1105,7 +1105,11 @@ def test_spirv(ctx_factory):
     b_dev = cl.clrandom.rand(queue, n, np.float32)
     dest_dev = cl_array.empty_like(a_dev)
 
-    with open("add-vectors-%d.spv" % queue.device.address_bits, "rb") as spv_file:
+    from os.path import dirname, join
+    spv_filename = join(dirname(__file__),
+            "add-vectors-%d.spv" % queue.device.address_bits)
+
+    with open(spv_filename, "rb") as spv_file:
         spv = spv_file.read()
 
     prg = cl.Program(ctx, spv).build()