Skip to content

Commit

Permalink
Skip failing tests on pypy shard. (#478)
Browse files Browse the repository at this point in the history
Temporary relief for #477

Closes #463
  • Loading branch information
kwlzn authored May 14, 2018
1 parent 0ada560 commit c1fa403
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
7 changes: 7 additions & 0 deletions pex/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
from .util import DistributionHelper, named_temporary_file
from .version import SETUPTOOLS_REQUIREMENT

NOT_CPYTHON_36 = (
"hasattr(sys, 'pypy_version_info') or "
"(sys.version_info[0], sys.version_info[1]) != (3, 6)"
)

PYPY = "hasattr(sys, 'pypy_version_info')"


@contextlib.contextmanager
def temporary_dir():
Expand Down
14 changes: 9 additions & 5 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from pex.installer import EggInstaller
from pex.pex_bootstrapper import get_pex_info
from pex.testing import (
NOT_CPYTHON_36,
PYPY,
ensure_python_interpreter,
get_dep_dist_names_from_pex,
run_pex_command,
Expand All @@ -21,11 +23,6 @@
)
from pex.util import DistributionHelper, named_temporary_file

NOT_CPYTHON_36 = (
"hasattr(sys, 'pypy_version_info') or "
"(sys.version_info[0], sys.version_info[1]) != (3, 6)"
)


def test_pex_execute():
body = "print('Hello')"
Expand Down Expand Up @@ -343,6 +340,7 @@ def test_interpreter_constraints_to_pex_info_py2():
assert set(['>=2.7', '<3']) == set(pex_info.interpreter_constraints)


@pytest.mark.skipif(PYPY)
def test_interpreter_constraints_to_pex_info_py3():
py3_interpreter = ensure_python_interpreter('3.6.3')
with environment_as(PATH=os.path.dirname(py3_interpreter)):
Expand Down Expand Up @@ -370,6 +368,7 @@ def test_interpreter_resolution_with_constraint_option():
assert pex_info.build_properties['version'][0] < 3


@pytest.mark.skipif(PYPY)
def test_interpreter_resolution_with_pex_python_path():
with temporary_dir() as td:
pexrc_path = os.path.join(td, '.pexrc')
Expand Down Expand Up @@ -446,6 +445,7 @@ def test_plain_pex_exec_no_ppp_no_pp_no_constraints():
assert str(sys.executable).encode() in stdout


@pytest.mark.skipif(PYPY)
def test_pex_exec_with_pex_python_path_only():
with temporary_dir() as td:
pexrc_path = os.path.join(td, '.pexrc')
Expand All @@ -471,6 +471,7 @@ def test_pex_exec_with_pex_python_path_only():
assert str(pex_python_path.split(':')[0]).encode() in stdout


@pytest.mark.skipif(PYPY)
def test_pex_exec_with_pex_python_path_and_pex_python_but_no_constraints():
with temporary_dir() as td:
pexrc_path = os.path.join(td, '.pexrc')
Expand Down Expand Up @@ -498,6 +499,7 @@ def test_pex_exec_with_pex_python_path_and_pex_python_but_no_constraints():
assert str(pex_python_path.split(':')[0]).encode() in stdout


@pytest.mark.skipif(PYPY)
def test_pex_python():
py2_path_interpreter = ensure_python_interpreter('2.7.10')
py3_path_interpreter = ensure_python_interpreter('3.6.3')
Expand Down Expand Up @@ -558,6 +560,7 @@ def test_pex_python():
assert correct_interpreter_path in stdout


@pytest.mark.skipif(PYPY)
def test_entry_point_targeting():
"""Test bugfix for https://github.com/pantsbuild/pex/issues/434"""
with temporary_dir() as td:
Expand All @@ -578,6 +581,7 @@ def test_entry_point_targeting():
assert 'usage: autopep8'.encode() in stdout


@pytest.mark.skipif(PYPY)
def test_interpreter_selection_using_os_environ_for_bootstrap_reexec():
"""
This is a test for verifying the proper function of the
Expand Down
4 changes: 3 additions & 1 deletion tests/test_pex_bootstrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

import os

import pytest
from twitter.common.contextutil import temporary_dir

from pex.common import open_zip
from pex.interpreter import PythonInterpreter
from pex.pex_bootstrapper import find_compatible_interpreters, get_pex_info
from pex.testing import ensure_python_interpreter, write_simple_pex
from pex.testing import PYPY, ensure_python_interpreter, write_simple_pex


def test_get_pex_info():
Expand All @@ -31,6 +32,7 @@ def test_get_pex_info():
assert pex_info.dump() == pex_info_2.dump()


@pytest.mark.skipif(PYPY)
def test_find_compatible_interpreters():
pex_python_path = ':'.join([
ensure_python_interpreter('2.7.9'),
Expand Down

0 comments on commit c1fa403

Please sign in to comment.