Blob Blame History Raw
From 9e70838d0fe10576c8e991a2ac8cff09eab8a4b8 Mon Sep 17 00:00:00 2001
From: Lumir Balhar <lbalhar@redhat.com>
Date: Tue, 10 Jan 2023 08:34:25 +0100
Subject: [PATCH] fix tests

---
 pyproject.toml          |  5 -----
 src/tox/pytest.py       | 16 +++-------------
 tests/test_provision.py | 17 ++---------------
 3 files changed, 5 insertions(+), 33 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index c34eed8..4604c52 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -72,9 +72,6 @@ optional-dependencies.docs = [
 ]
 optional-dependencies.testing = [
   "build[virtualenv]>=1.0.3",
-  "covdefaults>=2.3",
-  "detect-test-pollution>=1.2",
-  "devpi-process>=1",
   "diff-cover>=8.0.2",
   "distlib>=0.3.8",
   "flaky>=3.7",
@@ -82,7 +79,6 @@ optional-dependencies.testing = [
   "hatchling>=1.21",
   "psutil>=5.9.7",
   "pytest>=7.4.4",
-  "pytest-cov>=4.1",
   "pytest-mock>=3.12",
   "pytest-xdist>=3.5",
   "re-assert>=1.1",
@@ -162,7 +158,6 @@ paths.source = [
 report.fail_under = 88
 report.omit = ["src/tox/config/cli/for_docs.py", "tests/execute/local_subprocess/bad_process.py", "tests/type_check/*"]
 run.parallel = true
-run.plugins = ["covdefaults"]
 
 [tool.towncrier]
 name = "tox"
diff --git a/src/tox/pytest.py b/src/tox/pytest.py
index d734def..5e6df35 100644
--- a/src/tox/pytest.py
+++ b/src/tox/pytest.py
@@ -17,7 +17,6 @@ from typing import TYPE_CHECKING, Any, Callable, Iterator, Protocol, Sequence, c
 
 import pytest
 from _pytest.fixtures import SubRequest  # noqa: PLC2701
-from devpi_process import IndexServer
 from virtualenv.info import fs_supports_symlink
 
 import tox.run
@@ -277,9 +276,9 @@ class ToxProject:
                 m.setattr(sys, "argv", [sys.executable, "-m", "tox", *list(args)])
                 m.setenv("VIRTUALENV_SYMLINK_APP_DATA", "1")
                 m.setenv("VIRTUALENV_SYMLINKS", "1")
-                m.setenv("VIRTUALENV_PIP", "embed")
-                m.setenv("VIRTUALENV_WHEEL", "embed")
-                m.setenv("VIRTUALENV_SETUPTOOLS", "embed")
+                m.setenv("VIRTUALENV_PIP", "bundle")
+                m.setenv("VIRTUALENV_WHEEL", "bundle")
+                m.setenv("VIRTUALENV_SETUPTOOLS", "bundle")
                 try:
                     tox_run(args)
                 except SystemExit as exception:
@@ -472,15 +471,6 @@ def enable_pypi_server(monkeypatch: pytest.MonkeyPatch, url: str | None) -> None
     monkeypatch.setenv("PIP_TIMEOUT", str(2))
 
 
-@pytest.fixture(scope="session")
-def pypi_server(tmp_path_factory: pytest.TempPathFactory) -> Iterator[IndexServer]:
-    # takes around 2.5s
-    path = tmp_path_factory.mktemp("pypi")
-    with IndexServer(path) as server:
-        server.create_index("empty", "volatile=False")
-        yield server
-
-
 @pytest.fixture(scope="session")
 def _invalid_index_fake_port() -> int:  # noqa: PT005
     with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as socket_handler:
diff --git a/tests/test_provision.py b/tests/test_provision.py
index 41eb630..1df7e76 100644
--- a/tests/test_provision.py
+++ b/tests/test_provision.py
@@ -92,21 +92,9 @@ def tox_wheels(tox_wheel: Path, tmp_path_factory: TempPathFactory) -> list[Path]
         return result
 
 
-@pytest.fixture(scope="session")
-def pypi_index_self(pypi_server: IndexServer, tox_wheels: list[Path], demo_pkg_inline_wheel: Path) -> Index:
-    with elapsed("start devpi and create index"):  # takes around 1s
-        self_index = pypi_server.create_index("self", "volatile=False")
-    with elapsed("upload tox and its wheels to devpi"):  # takes around 3.2s on build
-        self_index.upload(*tox_wheels, demo_pkg_inline_wheel)
-    return self_index
-
-
 @pytest.fixture()
-def _pypi_index_self(pypi_index_self: Index, monkeypatch: MonkeyPatch) -> None:
-    pypi_index_self.use()
-    monkeypatch.setenv("PIP_INDEX_URL", pypi_index_self.url)
-    monkeypatch.setenv("PIP_RETRIES", str(2))
-    monkeypatch.setenv("PIP_TIMEOUT", str(5))
+def _pypi_index_self():
+    pytest.skip("needs devpi-process")
 
 
 def test_provision_requires_nok(tox_project: ToxProjectCreator) -> None:
@@ -155,7 +143,6 @@ def test_provision_requires_ok(tox_project: ToxProjectCreator, tmp_path: Path) -
 
 
 @pytest.mark.integration()
-@pytest.mark.usefixtures("_pypi_index_self")
 def test_provision_platform_check(tox_project: ToxProjectCreator) -> None:
     ini = "[tox]\nrequires=demo-pkg-inline\n[testenv]\npackage=skip\n[testenv:.tox]\nplatform=wrong_platform"
     proj = tox_project({"tox.ini": ini})
-- 
2.44.0