diff --git a/tests/integration/workflows/python_pip/test_python_pip.py b/tests/integration/workflows/python_pip/test_python_pip.py index 39b244d5f..3a0aff97e 100644 --- a/tests/integration/workflows/python_pip/test_python_pip.py +++ b/tests/integration/workflows/python_pip/test_python_pip.py @@ -1,5 +1,6 @@ import os import shutil +import six import sys import platform import tempfile @@ -137,7 +138,15 @@ def test_mismatch_runtime_python_project(self): runtime=self.runtime_mismatch[self.runtime], ) except WorkflowFailedError as ex: - self.assertIn("Binary validation failed", str(ex)) + # handle both e.g. missing /usr/bin/python2.7 and situation where + # python2.7 does not have pip installed (as is the case in some + # Mac environments) + ex_s = str(ex) + if ( + "Binary validation failed" not in ex_s + and "pip executable not found in your python environment" not in ex_s + ): + six.raise_from(AssertionError("Unexpected exception"), ex) def test_runtime_validate_python_project_fail_open_unsupported_runtime(self): with self.assertRaises(WorkflowFailedError):