Skip to content

OSX Python 3 - pytest_run can't resolve coverage and pytest-cov #6397

@Eric-Arellano

Description

@Eric-Arellano

Issue

On OSX only, almost every test fails in pytest_run with a TaskError and captured stderr similar to this:

                    -------------- Captured stderr call --------------

                     Starting workunit run
                     Failed to execute PEX file, missing macosx_10_13_x86_64-cp-27-cp27m compatible dependencies for:
                     pytest-cov
                     coverage

To reproduce

  1. Apply this diff to avoid running all unit tests in folder:
diff --git a/tests/python/pants_test/backend/python/tasks/BUILD b/tests/python/pants_test/backend/python/tasks/BUILD
index 4325fa90b..2fefff482 100644
--- a/tests/python/pants_test/backend/python/tasks/BUILD
+++ b/tests/python/pants_test/backend/python/tasks/BUILD
@@ -50,7 +50,7 @@ python_tests(
 )

 python_tests(
-  sources=globs('test_*.py', exclude=([globs('*_integration.py')] + python_native_code_test_files)),
+  sources='test_pytest_run.py',
   dependencies=[
     ':python_task_test_base',
     '3rdparty/python/twitter/commons:twitter.common.collections',
  1. ./pants clean-all
  2. ./pants --python-setup-interpreter-constraints='["CPython>=3.5"]' test tests/python/pants_test/backend/python/tasks:tasks

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions