setup.cfg | 1 - tests/integration/test_package_int.py | 4 +++- tests/integration/test_parallel_interrupt.py | 14 ++++++++++++++ tests/integration/test_provision_int.py | 2 ++ tests/unit/interpreters/test_interpreters.py | 4 ++-- .../unit/package/builder/test_package_builder_isolated.py | 1 + tests/unit/session/test_provision.py | 1 + tests/unit/session/test_session.py | 2 +- tests/unit/test_z_cmdline.py | 14 ++++++++++++++ tox.ini | 9 +++++++-- 10 files changed, 45 insertions(+), 7 deletions(-) diff --git a/setup.cfg b/setup.cfg index 37013e3..88912ec 100644 --- a/setup.cfg +++ b/setup.cfg @@ -64,7 +64,6 @@ testing = flaky>=3.4.0 freezegun>=0.3.11 pytest>=4.0.0 - pytest-cov>=2.5.1 pytest-mock>=1.10.0 pytest-randomly>=1.0.0 pathlib2>=2.3.3;python_version<"3.4" diff --git a/tests/integration/test_package_int.py b/tests/integration/test_package_int.py index 01c59f6..d33bac9 100644 --- a/tests/integration/test_package_int.py +++ b/tests/integration/test_package_int.py @@ -28,7 +28,7 @@ def test_package_setuptools(initproj, cmd): ), "pyproject.toml": """\ [build-system] - requires = ["setuptools >= 35.0.2", "setuptools_scm >= 2.0.0, <3"] + requires = ["setuptools >= 35.0.2"] build-backend = "setuptools.build_meta" """, }, @@ -37,6 +37,7 @@ def test_package_setuptools(initproj, cmd): @pytest.mark.network +@pytest.mark.internet @need_git @pytest.mark.skipif(sys.version_info < (3, 0), reason="flit is Python 3 only") def test_package_flit(initproj, cmd): @@ -81,6 +82,7 @@ def test_package_flit(initproj, cmd): @pytest.mark.network +@pytest.mark.internet @pytest.mark.skipif(sys.version_info < (3, 0), reason="poetry is Python 3 only") def test_package_poetry(initproj, cmd): initproj( diff --git a/tests/integration/test_parallel_interrupt.py b/tests/integration/test_parallel_interrupt.py index b89072a..244b7e6 100644 --- a/tests/integration/test_parallel_interrupt.py +++ b/tests/integration/test_parallel_interrupt.py @@ -1,5 +1,7 @@ from __future__ import absolute_import, unicode_literals +import os +import errno import signal import subprocess import sys @@ -16,6 +18,14 @@ else: from tox.constants import INFO from tox.util.main import MAIN_FILE +def is_hidepid(): + try: + os.lstat('/proc/1/stat') + except OSError as e: + return e.errno in (errno.EPERM, errno.ENOENT) + else: + return False + @flaky(max_runs=3) @pytest.mark.skipif(INFO.IS_PYPY, reason="TODO: process numbers work differently on pypy") @@ -23,6 +33,10 @@ from tox.util.main import MAIN_FILE "sys.platform == 'win32'", reason="triggering SIGINT reliably on Windows is hard", ) +@pytest.mark.skipif( + is_hidepid(), + reason="/proc is mounted with hidepid 1/2" +) def test_parallel_interrupt(initproj, monkeypatch, capfd): monkeypatch.setenv(str("_TOX_SKIP_ENV_CREATION_TEST"), str("1")) monkeypatch.setenv(str("TOX_REPORTER_TIMESTAMP"), str("1")) diff --git a/tests/integration/test_provision_int.py b/tests/integration/test_provision_int.py index f1763e4..0c4b9a3 100644 --- a/tests/integration/test_provision_int.py +++ b/tests/integration/test_provision_int.py @@ -13,6 +13,8 @@ else: from tox.constants import INFO from tox.util.main import MAIN_FILE +pytestmark = pytest.mark.internet + @pytest.mark.skipif( "sys.platform == 'win32' and sys.version_info < (3,)", diff --git a/tests/unit/interpreters/test_interpreters.py b/tests/unit/interpreters/test_interpreters.py index 298a4aa..6001135 100644 --- a/tests/unit/interpreters/test_interpreters.py +++ b/tests/unit/interpreters/test_interpreters.py @@ -49,7 +49,7 @@ def test_tox_get_python_executable(mocker): p = tox_get_python_executable(envconfig) assert p == py.path.local(sys.executable) - for major, minor in [(2, 7), (3, 5), (3, 6), (3, 7), (3, 8)]: + for major, minor in [(3, 5), (3, 6), (3, 7), (3, 8)]: name = "python{}.{}".format(major, minor) if tox.INFO.IS_WIN: pydir = "python{}{}".format(major, minor) @@ -62,7 +62,7 @@ def test_tox_get_python_executable(mocker): exe = get_exe(name) assert_version_in_output(exe, "{}.{}".format(major, minor)) has_py_exe = py.path.local.sysfind("py") is not None - for major in (2, 3): + for major in (3,): name = "python{}".format(major) if has_py_exe: error_code = subprocess.call(("py", "-{}".format(major), "-c", "")) diff --git a/tests/unit/package/builder/test_package_builder_isolated.py b/tests/unit/package/builder/test_package_builder_isolated.py index 8a41f2d..6ca037e 100644 --- a/tests/unit/package/builder/test_package_builder_isolated.py +++ b/tests/unit/package/builder/test_package_builder_isolated.py @@ -205,6 +205,7 @@ def test_isolated_build_script_args(tmp_path): subprocess.check_call(("python", script_path, str(tmp_path), "setuptools.build_meta")) +@pytest.mark.internet def test_isolated_build_backend_missing_hook(initproj, cmd): """Verify that tox works with a backend missing optional hooks diff --git a/tests/unit/session/test_provision.py b/tests/unit/session/test_provision.py index 24f7b3d..9388985 100644 --- a/tests/unit/session/test_provision.py +++ b/tests/unit/session/test_provision.py @@ -333,6 +333,7 @@ def magic_non_canonical_wheel(wheel, tmp_path_factory): return wheel(magic_proj) +@pytest.mark.internet @pytest.mark.skipif(IS_PYPY and sys.version_info[0] > 2, reason="fails on pypy3") def test_provision_non_canonical_dep( cmd, diff --git a/tests/unit/session/test_session.py b/tests/unit/session/test_session.py index 93ae211..bbc7818 100644 --- a/tests/unit/session/test_session.py +++ b/tests/unit/session/test_session.py @@ -199,7 +199,7 @@ def popen_env_test(initproj, cmd, monkeypatch): "pyproject.toml" ] = """ [build-system] - requires = ["setuptools >= 35.0.2", "setuptools_scm >= 2.0.0, <3"] + requires = ["setuptools >= 35.0.2"] build-backend = 'setuptools.build_meta' """ initproj("env_var_test", filedefs=files) diff --git a/tests/unit/test_z_cmdline.py b/tests/unit/test_z_cmdline.py index c0549c0..1e2c17d 100644 --- a/tests/unit/test_z_cmdline.py +++ b/tests/unit/test_z_cmdline.py @@ -516,6 +516,13 @@ def example123(initproj): "tox.ini": """ [testenv] changedir=tests + sitepackages=True + allowlist_externals = + /bin/cp + /bin/sed + commands_pre= + /bin/cp /usr/bin/py.test3 {envbindir}/pytest + /bin/sed -i '1c #!{envpython}' {envbindir}/pytest commands= pytest --basetemp={envtmpdir} \ --junitxml=junit-{envname}.xml deps=pytest @@ -668,6 +675,13 @@ def test_test_usedevelop(cmd, initproj, src_root, skipsdist): [testenv] usedevelop=True changedir=tests + sitepackages=True + allowlist_externals = + /bin/cp + /bin/sed + commands_pre= + /bin/cp /usr/bin/py.test3 {envbindir}/pytest + /bin/sed -i '1c #!{envpython}' {envbindir}/pytest commands= pytest --basetemp={envtmpdir} --junitxml=junit-{envname}.xml [] deps=pytest""" diff --git a/tox.ini b/tox.ini index c255752..2e7e6ef 100644 --- a/tox.ini +++ b/tox.ini @@ -32,10 +32,14 @@ setenv = {py27,pypy}: PYTHONWARNINGS = ignore:DEPRECATION::pip._internal.cli.base_command extras = testing +allowlist_externals = + /bin/cp + /bin/sed +commands_pre = + /bin/cp /usr/bin/py.test3 {envbindir}/pytest + /bin/sed -i '1c #!{envpython}' {envbindir}/pytest commands = pytest \ - --cov "{envsitepackagesdir}/tox" \ - --cov-config "{toxinidir}/tox.ini" \ --junitxml {toxworkdir}/junit.{envname}.xml \ {posargs:.} @@ -170,6 +174,7 @@ xfail_strict = True markers = git network + internet: mark a test as a test requiring internet [isort] profile = black