| |
@@ -1,57 +1,58 @@
|
| |
- From eb6cd0a5fe1734c5eee78b9889ba7a07fdeb2111 Mon Sep 17 00:00:00 2001
|
| |
+ From c23f636eef39220989fcfde7aed6a505aaca993c 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 | 4 ----
|
| |
+ pyproject.toml | 5 -----
|
| |
src/tox/pytest.py | 16 +++-------------
|
| |
- tests/test_provision.py | 18 ++----------------
|
| |
+ tests/test_provision.py | 17 ++---------------
|
| |
3 files changed, 5 insertions(+), 33 deletions(-)
|
| |
|
| |
diff --git a/pyproject.toml b/pyproject.toml
|
| |
- index 19ee5ec..b806958 100644
|
| |
+ index 9bdfbca..51c6980 100644
|
| |
--- a/pyproject.toml
|
| |
+++ b/pyproject.toml
|
| |
- @@ -73,8 +73,6 @@ optional-dependencies.docs = [
|
| |
+ @@ -72,9 +72,6 @@ optional-dependencies.docs = [
|
| |
]
|
| |
optional-dependencies.testing = [
|
| |
"build[virtualenv]>=0.10",
|
| |
- "covdefaults>=2.3",
|
| |
- - "devpi-process>=0.3",
|
| |
- "diff-cover>=7.5",
|
| |
- "distlib>=0.3.6",
|
| |
+ - "detect-test-pollution>=1.1.1",
|
| |
+ - "devpi-process>=1",
|
| |
+ "diff-cover>=7.7",
|
| |
+ "distlib>=0.3.7",
|
| |
"flaky>=3.7",
|
| |
- @@ -82,7 +80,6 @@ optional-dependencies.testing = [
|
| |
- "hatchling>=1.14",
|
| |
- "psutil>=5.9.4",
|
| |
- "pytest>=7.2.2",
|
| |
- - "pytest-cov>=4",
|
| |
- "pytest-mock>=3.10",
|
| |
- "pytest-xdist>=3.2.1",
|
| |
+ @@ -82,7 +79,6 @@ optional-dependencies.testing = [
|
| |
+ "hatchling>=1.18",
|
| |
+ "psutil>=5.9.5",
|
| |
+ "pytest>=7.4",
|
| |
+ - "pytest-cov>=4.1",
|
| |
+ "pytest-mock>=3.11.1",
|
| |
+ "pytest-xdist>=3.3.1",
|
| |
"re-assert>=1.1",
|
| |
- @@ -120,7 +117,6 @@ paths.source = [
|
| |
+ @@ -148,7 +144,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.isort]
|
| |
- known_first_party = ["tox", "tests"]
|
| |
+ [tool.mypy]
|
| |
+ python_version = "3.11"
|
| |
diff --git a/src/tox/pytest.py b/src/tox/pytest.py
|
| |
- index 0bc9905..65701b5 100644
|
| |
+ index d7243bd..0e14e5d 100644
|
| |
--- a/src/tox/pytest.py
|
| |
+++ b/src/tox/pytest.py
|
| |
- @@ -26,7 +26,6 @@ from _pytest.logging import LogCaptureFixture
|
| |
- from _pytest.monkeypatch import MonkeyPatch
|
| |
- from _pytest.python import Function
|
| |
- from _pytest.tmpdir import TempPathFactory
|
| |
+ @@ -16,7 +16,6 @@ from typing import TYPE_CHECKING, Any, Callable, Iterator, Protocol, Sequence, c
|
| |
+
|
| |
+ import pytest
|
| |
+ from _pytest.fixtures import SubRequest
|
| |
-from devpi_process import IndexServer
|
| |
- from pytest_mock import MockerFixture
|
| |
from virtualenv.info import fs_supports_symlink
|
| |
|
| |
- @@ -286,9 +285,9 @@ class ToxProject:
|
| |
- m.setattr(sys, "argv", [sys.executable, "-m", "tox"] + list(args))
|
| |
+ import tox.run
|
| |
+ @@ -276,9 +275,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")
|
| |
@@ -63,12 +64,12 @@
|
| |
try:
|
| |
tox_run(args)
|
| |
except SystemExit as exception:
|
| |
- @@ -472,15 +471,6 @@ def enable_pypi_server(monkeypatch: MonkeyPatch, url: str | None) -> None:
|
| |
+ @@ -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: TempPathFactory) -> Iterator[IndexServer]:
|
| |
+ -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:
|
| |
@@ -80,18 +81,10 @@
|
| |
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 290e48d..475d7f4 100644
|
| |
+ index f9275fb..ddf8607 100644
|
| |
--- a/tests/test_provision.py
|
| |
+++ b/tests/test_provision.py
|
| |
- @@ -12,7 +12,6 @@ from unittest import mock
|
| |
- from zipfile import ZipFile
|
| |
-
|
| |
- import pytest
|
| |
- -from devpi_process import Index, IndexServer
|
| |
- from filelock import FileLock
|
| |
- from packaging.requirements import Requirement
|
| |
-
|
| |
- @@ -93,21 +92,9 @@ def tox_wheels(tox_wheel: Path, tmp_path_factory: TempPathFactory) -> list[Path]
|
| |
+ @@ -92,21 +92,9 @@ def tox_wheels(tox_wheel: Path, tmp_path_factory: TempPathFactory) -> list[Path]
|
| |
return result
|
| |
|
| |
|
| |
@@ -115,7 +108,7 @@
|
| |
|
| |
|
| |
def test_provision_requires_nok(tox_project: ToxProjectCreator) -> None:
|
| |
- @@ -156,7 +143,6 @@ def test_provision_requires_ok(tox_project: ToxProjectCreator, tmp_path: Path) -
|
| |
+ @@ -155,7 +143,6 @@ def test_provision_requires_ok(tox_project: ToxProjectCreator, tmp_path: Path) -
|
| |
|
| |
|
| |
@pytest.mark.integration()
|
| |
@@ -124,5 +117,5 @@
|
| |
ini = "[tox]\nrequires=demo-pkg-inline\n[testenv]\npackage=skip\n[testenv:.tox]\nplatform=wrong_platform"
|
| |
proj = tox_project({"tox.ini": ini})
|
| |
--
|
| |
- 2.39.2
|
| |
+ 2.40.1
|
| |
|
| |