diff --git a/scipy/sparse/tests/test_matrix_io.py b/scipy/sparse/tests/test_matrix_io.py
index d97f1fdef..7a2530c44 100644
--- a/scipy/sparse/tests/test_matrix_io.py
+++ b/scipy/sparse/tests/test_matrix_io.py
@@ -63,7 +63,7 @@ def test_malicious_load():
     fd, tmpfile = tempfile.mkstemp(suffix='.npz')
     os.close(fd)
     try:
-        np.savez(tmpfile, format=Executor())
+        np.savez(tmpfile, allow_pickle=True, format=Executor())
 
         # Should raise a ValueError, not execute code
         assert_raises(ValueError, load_npz, tmpfile)
