summaryrefslogtreecommitdiff
path: root/tests/session
diff options
context:
space:
mode:
authorBernát Gábor <bgabor8@bloomberg.net>2021-11-17 10:07:27 +0000
committerGitHub <noreply@github.com>2021-11-17 10:07:27 +0000
commit6b1cc141aeb9501aa23774056fbc7179b719e200 (patch)
treec6f323b1ca6a0a86a951358b1872db965cdfee06 /tests/session
parent84acf045fb39e642ec5e82b3824b7450c6b63225 (diff)
downloadtox-git-6b1cc141aeb9501aa23774056fbc7179b719e200.tar.gz
Drop python 3.6 support (#2275)
Diffstat (limited to 'tests/session')
-rw-r--r--tests/session/cmd/run/test_common.py5
-rw-r--r--tests/session/cmd/test_depends.py6
-rw-r--r--tests/session/cmd/test_devenv.py4
-rw-r--r--tests/session/cmd/test_exec_.py5
-rw-r--r--tests/session/cmd/test_legacy.py2
-rw-r--r--tests/session/cmd/test_list_envs.py2
-rw-r--r--tests/session/cmd/test_parallel.py2
-rw-r--r--tests/session/cmd/test_quickstart.py2
-rw-r--r--tests/session/cmd/test_sequential.py8
-rw-r--r--tests/session/cmd/test_show_config.py8
-rw-r--r--tests/session/cmd/test_state.py2
-rw-r--r--tests/session/test_session_common.py2
12 files changed, 34 insertions, 14 deletions
diff --git a/tests/session/cmd/run/test_common.py b/tests/session/cmd/run/test_common.py
index 0836d7a5..5f8cf476 100644
--- a/tests/session/cmd/run/test_common.py
+++ b/tests/session/cmd/run/test_common.py
@@ -1,7 +1,8 @@
+from __future__ import annotations
+
import re
from argparse import ArgumentError, ArgumentParser, Namespace
from pathlib import Path
-from typing import Optional
import pytest
@@ -9,7 +10,7 @@ from tox.session.cmd.run.common import InstallPackageAction, SkipMissingInterpre
@pytest.mark.parametrize("values", ["config", None, "true", "false"])
-def test_skip_missing_interpreter_action_ok(values: Optional[str]) -> None:
+def test_skip_missing_interpreter_action_ok(values: str | None) -> None:
args_namespace = Namespace()
SkipMissingInterpreterAction(option_strings=["-i"], dest="into")(ArgumentParser(), args_namespace, values)
expected = "true" if values is None else values
diff --git a/tests/session/cmd/test_depends.py b/tests/session/cmd/test_depends.py
index 98d6c555..b6c7b44a 100644
--- a/tests/session/cmd/test_depends.py
+++ b/tests/session/cmd/test_depends.py
@@ -1,5 +1,7 @@
+from __future__ import annotations
+
import sys
-from typing import Callable, Tuple
+from typing import Callable
import pytest
@@ -9,7 +11,7 @@ from tox.pytest import ToxProjectCreator
@pytest.mark.parametrize("has_prev", [True, False])
def test_depends(
tox_project: ToxProjectCreator,
- patch_prev_py: Callable[[bool], Tuple[str, str]],
+ patch_prev_py: Callable[[bool], tuple[str, str]],
has_prev: bool,
) -> None:
prev_ver, impl = patch_prev_py(has_prev)
diff --git a/tests/session/cmd/test_devenv.py b/tests/session/cmd/test_devenv.py
index be9d00ac..4b8c4d04 100644
--- a/tests/session/cmd/test_devenv.py
+++ b/tests/session/cmd/test_devenv.py
@@ -1,4 +1,4 @@
-from typing import Optional
+from __future__ import annotations
import pytest
@@ -13,7 +13,7 @@ def test_devenv_fail_multiple_target(tox_project: ToxProjectCreator) -> None:
@pytest.mark.integration()
-def test_devenv_ok(tox_project: ToxProjectCreator, enable_pip_pypi_access: Optional[str]) -> None: # noqa: U100
+def test_devenv_ok(tox_project: ToxProjectCreator, enable_pip_pypi_access: str | None) -> None: # noqa: U100
content = {"setup.py": "from setuptools import setup\nsetup(name='demo', version='1.0')"}
outcome = tox_project(content).run("d", "-e", "py")
outcome.assert_success()
diff --git a/tests/session/cmd/test_exec_.py b/tests/session/cmd/test_exec_.py
index 223d157b..0c6a18b8 100644
--- a/tests/session/cmd/test_exec_.py
+++ b/tests/session/cmd/test_exec_.py
@@ -1,5 +1,6 @@
+from __future__ import annotations
+
import sys
-from typing import List
import pytest
@@ -7,7 +8,7 @@ from tox.pytest import ToxProjectCreator
@pytest.mark.parametrize("trail", [[], ["--"]], ids=["no_posargs", "empty_posargs"])
-def test_exec_fail_no_posargs(tox_project: ToxProjectCreator, trail: List[str]) -> None:
+def test_exec_fail_no_posargs(tox_project: ToxProjectCreator, trail: list[str]) -> None:
outcome = tox_project({"tox.ini": ""}).run("e", "-e", "py39", *trail)
outcome.assert_failed()
msg = "ROOT: HandledError| You must specify a command as positional arguments, use -- <command>\n"
diff --git a/tests/session/cmd/test_legacy.py b/tests/session/cmd/test_legacy.py
index 222cdf4d..fc9b1219 100644
--- a/tests/session/cmd/test_legacy.py
+++ b/tests/session/cmd/test_legacy.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
from pathlib import Path
import pytest
diff --git a/tests/session/cmd/test_list_envs.py b/tests/session/cmd/test_list_envs.py
index c11c4b76..27eef749 100644
--- a/tests/session/cmd/test_list_envs.py
+++ b/tests/session/cmd/test_list_envs.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
import pytest
from tox.pytest import ToxProject, ToxProjectCreator
diff --git a/tests/session/cmd/test_parallel.py b/tests/session/cmd/test_parallel.py
index 558a9c80..dc4e21e6 100644
--- a/tests/session/cmd/test_parallel.py
+++ b/tests/session/cmd/test_parallel.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
import sys
from argparse import ArgumentTypeError
from pathlib import Path
diff --git a/tests/session/cmd/test_quickstart.py b/tests/session/cmd/test_quickstart.py
index 829b8a97..67087059 100644
--- a/tests/session/cmd/test_quickstart.py
+++ b/tests/session/cmd/test_quickstart.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
import sys
from textwrap import dedent
diff --git a/tests/session/cmd/test_sequential.py b/tests/session/cmd/test_sequential.py
index 6c83ad97..dc97db0f 100644
--- a/tests/session/cmd/test_sequential.py
+++ b/tests/session/cmd/test_sequential.py
@@ -1,8 +1,10 @@
+from __future__ import annotations
+
import json
import re
import sys
from pathlib import Path
-from typing import Any, Dict, List, Optional, Tuple, Union
+from typing import Any
import pytest
from re_assert import Matches
@@ -43,7 +45,7 @@ def test_run_sequential_fail(tox_project: ToxProjectCreator) -> None:
@pytest.mark.integration()
def test_result_json_sequential(
tox_project: ToxProjectCreator,
- enable_pip_pypi_access: Optional[str], # noqa: U100
+ enable_pip_pypi_access: str | None, # noqa: U100
) -> None:
cmd = [
"- python -c 'import sys; print(\"magic fail\", file=sys.stderr); sys.exit(1)'",
@@ -118,7 +120,7 @@ def test_result_json_sequential(
assert log_report == expected
-def get_cmd_exit_run_id(report: Dict[str, Any], name: str, group: str) -> List[Tuple[Union[int, None], str]]:
+def get_cmd_exit_run_id(report: dict[str, Any], name: str, group: str) -> list[tuple[int | None, str]]:
return [(i["retcode"], i["run_id"]) for i in report["testenvs"][name].pop(group)]
diff --git a/tests/session/cmd/test_show_config.py b/tests/session/cmd/test_show_config.py
index b631d765..0d751ba3 100644
--- a/tests/session/cmd/test_show_config.py
+++ b/tests/session/cmd/test_show_config.py
@@ -1,9 +1,11 @@
+from __future__ import annotations
+
import platform
import sys
from configparser import ConfigParser
from pathlib import Path
from textwrap import dedent
-from typing import Callable, Tuple
+from typing import Callable
import pytest
from pytest_mock import MockerFixture
@@ -112,7 +114,7 @@ def test_pass_env_config_default(tox_project: ToxProjectCreator, stdout_is_atty:
def test_show_config_pkg_env_once(
tox_project: ToxProjectCreator,
- patch_prev_py: Callable[[bool], Tuple[str, str]],
+ patch_prev_py: Callable[[bool], tuple[str, str]],
) -> None:
prev_ver, impl = patch_prev_py(True)
project = tox_project(
@@ -128,7 +130,7 @@ def test_show_config_pkg_env_once(
def test_show_config_pkg_env_skip(
tox_project: ToxProjectCreator,
- patch_prev_py: Callable[[bool], Tuple[str, str]],
+ patch_prev_py: Callable[[bool], tuple[str, str]],
) -> None:
prev_ver, impl = patch_prev_py(False)
project = tox_project(
diff --git a/tests/session/cmd/test_state.py b/tests/session/cmd/test_state.py
index 7350584d..1a4c5081 100644
--- a/tests/session/cmd/test_state.py
+++ b/tests/session/cmd/test_state.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
from tox.pytest import ToxProjectCreator
diff --git a/tests/session/test_session_common.py b/tests/session/test_session_common.py
index c0cf593f..8ad72bbc 100644
--- a/tests/session/test_session_common.py
+++ b/tests/session/test_session_common.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
import pytest
from tox.session.common import CliEnv