Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#3306)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Aug 5, 2024
1 parent 17435df commit 2cf190a
Show file tree
Hide file tree
Showing 27 changed files with 39 additions and 39 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.6
rev: 0.29.1
hooks:
- id: check-github-workflows
args: [ "--verbose" ]
Expand All @@ -20,11 +20,11 @@ repos:
- id: tox-ini-fmt
args: ["-p", "fix"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "2.1.4"
rev: "2.2.1"
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.5.0"
rev: "v0.5.6"
hooks:
- id: ruff-format
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion src/tox/config/loader/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def __repr__(self) -> str:
def __contains__(self, item: str) -> bool:
return item in self.found_keys()

def load( # noqa: PLR0913
def load(
self,
key: str,
of_type: type[V],
Expand Down
2 changes: 1 addition & 1 deletion src/tox/config/loader/ini/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
class IniLoader(StrConvert, Loader[str]):
"""Load configuration from an ini section (ini file is a string to string dictionary)."""

def __init__( # noqa: PLR0913
def __init__(
self,
section: Section,
parser: ConfigParser,
Expand Down
4 changes: 2 additions & 2 deletions src/tox/config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
class Config:
"""Main configuration object for tox."""

def __init__( # noqa: PLR0913
def __init__(
self,
config_source: Source,
options: Parsed,
Expand Down Expand Up @@ -123,7 +123,7 @@ def core(self) -> CoreConfigSet:
self._core_set = core
return core

def get_section_config( # noqa: PLR0913
def get_section_config(
self,
section: Section,
base: list[str] | None,
Expand Down
2 changes: 1 addition & 1 deletion src/tox/execute/local_sub_process/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def interrupt(self) -> None: # noqa: PLR6301


class LocalSubProcessExecuteInstance(ExecuteInstance):
def __init__( # noqa: PLR0913
def __init__(
self,
request: ExecuteRequest,
options: ExecuteOptions,
Expand Down
2 changes: 1 addition & 1 deletion src/tox/execute/pep517_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def close(self) -> None:
class LocalSubProcessPep517ExecuteInstance(ExecuteInstance):
"""A backend invocation."""

def __init__( # noqa: PLR0913
def __init__(
self,
request: ExecuteRequest,
options: ExecuteOptions,
Expand Down
4 changes: 2 additions & 2 deletions src/tox/pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def interrupt(self) -> None: # noqa: PLR6301
return None # pragma: no cover

class MockExecuteInstance(ExecuteInstance):
def __init__( # noqa: PLR0913
def __init__(
self,
request: ExecuteRequest,
options: ExecuteOptions,
Expand Down Expand Up @@ -424,7 +424,7 @@ def _init(files: dict[str, Any], base: Path | None = None, prj_path: Path | None
return _init


@pytest.fixture()
@pytest.fixture
def empty_project(tox_project: ToxProjectCreator, monkeypatch: pytest.MonkeyPatch) -> ToxProject:
project = tox_project({"tox.ini": ""})
monkeypatch.chdir(project.path)
Expand Down
2 changes: 1 addition & 1 deletion src/tox/tox_env/python/pip/req/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def as_args(self) -> Iterator[str]:


class ParsedLine:
def __init__( # noqa: PLR0913
def __init__(
self,
filename: str,
lineno: int,
Expand Down
2 changes: 1 addition & 1 deletion src/tox/tox_env/python/virtual_env/package/pyproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def _send_msg(
if self._tox_env.conf["fresh_subprocess"]:
self.backend_executor.close()

def _unexpected_response( # noqa: PLR0913
def _unexpected_response(
self,
cmd: str,
got: Any,
Expand Down
2 changes: 1 addition & 1 deletion src/tox/util/spinner.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Spinner:
UNICODE_OUTCOME = Outcome(ok="✔", fail="✖", skip="⚠")
ASCII_OUTCOME = Outcome(ok="+", fail="!", skip="?")

def __init__( # noqa: PLR0913
def __init__(
self,
enabled: bool = True, # noqa: FBT001, FBT002
refresh_rate: float = 0.1,
Expand Down
2 changes: 1 addition & 1 deletion tests/config/cli/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from tox.session.state import State


@pytest.fixture()
@pytest.fixture
def core_handlers() -> dict[str, Callable[[State], int]]:
return {
"config": show_config,
Expand Down
4 changes: 2 additions & 2 deletions tests/config/cli/test_cli_ini.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from tox.session.state import State


@pytest.fixture()
@pytest.fixture
def default_options() -> dict[str, Any]:
return {
"colored": "no",
Expand Down Expand Up @@ -168,7 +168,7 @@ def test_conf_arg(tmp_path: Path, conf_arg: str, filename: str, content: str) ->
)


@pytest.fixture()
@pytest.fixture
def exhaustive_ini(tmp_path: Path, monkeypatch: MonkeyPatch) -> Path:
to = tmp_path / "tox.ini"
to.write_text(
Expand Down
2 changes: 1 addition & 1 deletion tests/config/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
from tox.config.main import Config


@pytest.fixture()
@pytest.fixture
def empty_config(tox_ini_conf: ToxIniCreator) -> Config:
return tox_ini_conf("")
2 changes: 1 addition & 1 deletion tests/config/loader/ini/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pathlib import Path


@pytest.fixture()
@pytest.fixture
def mk_ini_conf(tmp_path: Path) -> Callable[[str], ConfigParser]:
def _func(raw: str) -> ConfigParser:
filename = tmp_path / "demo.ini"
Expand Down
2 changes: 1 addition & 1 deletion tests/config/loader/ini/replace/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ReplaceOne(Protocol):
def __call__(self, conf: str, pos_args: list[str] | None = None) -> str: ...


@pytest.fixture()
@pytest.fixture
def replace_one(tmp_path: Path) -> ReplaceOne:
def example(conf: str, pos_args: list[str] | None = None) -> str:
tox_ini_file = tmp_path / "tox.ini"
Expand Down
2 changes: 1 addition & 1 deletion tests/config/loader/ini/replace/test_replace_env_var.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def test_replace_env_var_circular(replace_one: ReplaceOne, monkeypatch: MonkeyPa
assert result == "{env:MAGIC}"


@pytest.fixture()
@pytest.fixture
def reset_env_var_after_delay(monkeypatch: MonkeyPatch) -> Generator[threading.Thread, None, None]:
timeout = 2

Expand Down
2 changes: 1 addition & 1 deletion tests/config/loader/ini/replace/test_replace_tox_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
EnvConfigCreator = Callable[[str], ConfigSet]


@pytest.fixture()
@pytest.fixture
def example(tox_ini_conf: ToxIniCreator) -> EnvConfigCreator:
def func(conf: str) -> ConfigSet:
config = tox_ini_conf(f"""[tox]\nenv_list = a\n[testenv]\n{conf}\n""")
Expand Down
2 changes: 1 addition & 1 deletion tests/config/test_set_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __call__(
) -> SetEnv: ...


@pytest.fixture()
@pytest.fixture
def eval_set_env(tox_project: ToxProjectCreator) -> EvalSetEnv:
def func(tox_ini: str, extra_files: dict[str, Any] | None = None, from_cwd: Path | None = None) -> SetEnv:
prj = tox_project({"tox.ini": tox_ini, **(extra_files or {})})
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ToxIniCreator(Protocol):
def __call__(self, conf: str, override: Sequence[Override] | None = None) -> Config: ...


@pytest.fixture()
@pytest.fixture
def tox_ini_conf(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> ToxIniCreator:
def func(conf: str, override: Sequence[Override] | None = None) -> Config:
dest = tmp_path / "c"
Expand Down Expand Up @@ -78,7 +78,7 @@ def demo_pkg_inline() -> Iterator[Path]:
yield demo_path


@pytest.fixture()
@pytest.fixture
def patch_prev_py(mocker: MockerFixture) -> Callable[[bool], tuple[str, str]]:
def _func(has_prev: bool) -> tuple[str, str]:
ver = sys.version_info[0:2]
Expand Down
2 changes: 1 addition & 1 deletion tests/journal/test_main_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from tox.journal.main import Journal


@pytest.fixture()
@pytest.fixture
def base_info() -> dict[str, Any]:
return {
"reportversion": "1",
Expand Down
2 changes: 1 addition & 1 deletion tests/session/cmd/test_devenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_devenv_fail_multiple_target(tox_project: ToxProjectCreator) -> None:
outcome.assert_out_err(msg, "")


@pytest.mark.integration()
@pytest.mark.integration
def test_devenv_ok(tox_project: ToxProjectCreator, enable_pip_pypi_access: str | None) -> None: # noqa: ARG001
content = {
"setup.py": "from setuptools import setup\nsetup(name='demo', version='1.0')",
Expand Down
2 changes: 1 addition & 1 deletion tests/session/cmd/test_list_envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from tox.pytest import ToxProject, ToxProjectCreator


@pytest.fixture()
@pytest.fixture
def project(tox_project: ToxProjectCreator) -> ToxProject:
ini = """
[tox]
Expand Down
4 changes: 2 additions & 2 deletions tests/session/cmd/test_sequential.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_run_sequential_quiet(tox_project: ToxProjectCreator) -> None:
assert Matches(r" a: OK \([\d.]+ seconds\)") == reports[-2]


@pytest.mark.integration()
@pytest.mark.integration
def test_result_json_sequential(
tox_project: ToxProjectCreator,
enable_pip_pypi_access: str | None, # noqa: ARG001
Expand Down Expand Up @@ -156,7 +156,7 @@ def test_rerun_sequential_wheel(tox_project: ToxProjectCreator, demo_pkg_inline:
result_rerun.assert_success()


@pytest.mark.integration()
@pytest.mark.integration
def test_rerun_sequential_sdist(tox_project: ToxProjectCreator, demo_pkg_inline: Path) -> None:
proj = tox_project(
{"tox.ini": "[testenv]\npackage=sdist\ncommands=python -c 'from demo_pkg_inline import do; do()'"},
Expand Down
12 changes: 6 additions & 6 deletions tests/test_provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def pypi_index_self(pypi_server: IndexServer, tox_wheels: list[Path], demo_pkg_i
return self_index


@pytest.fixture()
@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)
Expand All @@ -127,7 +127,7 @@ def test_provision_requires_nok(tox_project: ToxProjectCreator) -> None:
)


@pytest.mark.integration()
@pytest.mark.integration
@pytest.mark.usefixtures("_pypi_index_self")
def test_provision_requires_ok(tox_project: ToxProjectCreator, tmp_path: Path) -> None:
proj = tox_project({"tox.ini": "[tox]\nrequires=demo-pkg-inline\n[testenv]\npackage=skip"})
Expand Down Expand Up @@ -160,7 +160,7 @@ def test_provision_requires_ok(tox_project: ToxProjectCreator, tmp_path: Path) -
assert f"ROOT: remove tox env folder {provision_env}" in result_recreate.out, result_recreate.out


@pytest.mark.integration()
@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"
Expand Down Expand Up @@ -194,7 +194,7 @@ def test_provision_no_recreate_json(tox_project: ToxProjectCreator) -> None:
assert requires == {"minversion": None, "requires": ["p", "tox"]}


@pytest.mark.integration()
@pytest.mark.integration
@pytest.mark.usefixtures("_pypi_index_self")
@pytest.mark.parametrize("plugin_testenv", ["testenv", "testenv:a"])
def test_provision_plugin_runner(tox_project: ToxProjectCreator, tmp_path: Path, plugin_testenv: str) -> None:
Expand All @@ -217,7 +217,7 @@ def test_provision_plugin_runner(tox_project: ToxProjectCreator, tmp_path: Path,
assert prov_msg in result_label.out


@pytest.mark.integration()
@pytest.mark.integration
def test_provision_plugin_runner_in_provision(tox_project: ToxProjectCreator, tmp_path: Path) -> None:
"""Ensure that provision environment can be explicitly configured."""
log = tmp_path / "out.log"
Expand All @@ -226,7 +226,7 @@ def test_provision_plugin_runner_in_provision(tox_project: ToxProjectCreator, tm
proj.run("r", "-e", "py", "--result-json", str(log))


@pytest.mark.integration()
@pytest.mark.integration
@pytest.mark.usefixtures("_pypi_index_self")
@pytest.mark.parametrize("relative_path", [True, False], ids=["relative", "absolute"])
def test_provision_conf_file(tox_project: ToxProjectCreator, tmp_path: Path, relative_path: bool) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def pkg_with_sdist(
return next(dist.iterdir())


@pytest.fixture()
@pytest.fixture
def pkg_with_extras_project_sdist(
pkg_with_extras_project: Path,
pkg_builder: Callable[[Path, Path, list[str], bool], Path],
Expand Down
2 changes: 1 addition & 1 deletion tests/tox_env/python/virtual_env/test_setuptools.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from tox.pytest import ToxProjectCreator


@pytest.mark.integration()
@pytest.mark.integration
def test_setuptools_package(
tox_project: ToxProjectCreator,
demo_pkg_setuptools: Path,
Expand Down
2 changes: 1 addition & 1 deletion tests/tox_env/python/virtual_env/test_virtualenv_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from tox.pytest import MonkeyPatch, ToxProject, ToxProjectCreator


@pytest.fixture()
@pytest.fixture
def virtualenv_opt(monkeypatch: MonkeyPatch, mocker: MockerFixture) -> VirtualEnvOptions:
for key in os.environ:
if key.startswith("VIRTUALENV_"): # pragma: no cover
Expand Down

0 comments on commit 2cf190a

Please sign in to comment.