Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion tests/integration/workflows/python_pip/test_python_pip.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import shutil
import six
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Consider not using six

Suggested change
import six

import sys
import platform
import tempfile
Expand Down Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Consider not using six

Suggested change
six.raise_from(AssertionError("Unexpected exception"), ex)
raise AssertionError("Unexpected exception") from ex


def test_runtime_validate_python_project_fail_open_unsupported_runtime(self):
with self.assertRaises(WorkflowFailedError):
Expand Down