diff --git a/sklearn/utils/_testing.py b/sklearn/utils/_testing.py
index 779e7b657..b54286355 100644
--- a/sklearn/utils/_testing.py
+++ b/sklearn/utils/_testing.py
@@ -749,6 +749,8 @@ def assert_run_python_script(source_code, timeout=60):
             except CalledProcessError as e:
                 raise RuntimeError(u"script errored with output:\n%s"
                                    % e.output.decode('utf-8'))
+            import re
+            out = re.sub(b'.*oneAPI.*\n?',b'', out)
             if out != b"":
                 raise AssertionError(out.decode('utf-8'))
         except TimeoutExpired as e:
