From b6201e209364a25729c3c734734a51d6d3699dae Mon Sep 17 00:00:00 2001 From: Ihor Kalnytskyi Date: Thu, 15 Aug 2024 23:24:45 +0300 Subject: [PATCH] Update Ruff to 0.6.x --- pyproject.toml | 5 +---- tests/conftest.py | 4 ++-- tests/ext/test_asgiscopes.py | 8 ++++---- tests/ext/test_flaskscopes.py | 10 +++++----- tests/ext/test_wsgiscopes.py | 4 ++-- tests/test_box.py | 4 ++-- tests/test_stack.py | 4 ++-- 7 files changed, 18 insertions(+), 21 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f0498f8..5a3b2e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ scripts.run = "python -m pytest --strict-markers {args:-vv}" [tool.hatch.envs.lint] detached = true -dependencies = ["ruff == 0.5.*"] +dependencies = ["ruff == 0.6.*"] scripts.run = ["ruff check {args:.}", "ruff format --check --diff {args:.}"] [tool.hatch.envs.type] @@ -58,9 +58,6 @@ line-length = 100 select = ["ALL"] ignore = ["ANN", "PLR", "D107", "D203", "D213", "D401", "SIM117", "N801", "PLW2901", "PERF203", "COM812", "ISC001"] -[tool.ruff.lint.isort] -known-first-party = ["picobox"] - [tool.ruff.lint.per-file-ignores] "docs/*" = ["INP001"] "examples/*" = ["I", "D", "T20", "INP001"] diff --git a/tests/conftest.py b/tests/conftest.py index 4d3ec79..a6b3b3e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -39,12 +39,12 @@ def any_value(request): return request.param -@pytest.fixture() +@pytest.fixture def supported_key(hashable_value): return hashable_value -@pytest.fixture() +@pytest.fixture def supported_value(any_value): return any_value diff --git a/tests/ext/test_asgiscopes.py b/tests/ext/test_asgiscopes.py index 09bc6af..16bd5f8 100644 --- a/tests/ext/test_asgiscopes.py +++ b/tests/ext/test_asgiscopes.py @@ -62,7 +62,7 @@ def connection_type(request): return request.param -@pytest.fixture() +@pytest.fixture def app_factory(connection_type): """A factory that creates test application instances.""" @@ -94,7 +94,7 @@ async def endpoint_ws(websocket, func=func): return factory -@pytest.fixture() +@pytest.fixture def client_factory(connection_type): """A factory that creates synchronous test client instances.""" @@ -104,7 +104,7 @@ def factory(app): return factory -@pytest.fixture() +@pytest.fixture def asyncclient_factory(connection_type): """A factory that creates asynchronous test client instances.""" @@ -384,7 +384,7 @@ async def endpoint2(): client2.run_endpoint("/2") -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_scope_request_is_request_bound(app_factory, asyncclient_factory): scope = asgiscopes.request() value = object() diff --git a/tests/ext/test_flaskscopes.py b/tests/ext/test_flaskscopes.py index 420071b..5ab6183 100644 --- a/tests/ext/test_flaskscopes.py +++ b/tests/ext/test_flaskscopes.py @@ -6,27 +6,27 @@ from picobox.ext import flaskscopes -@pytest.fixture() +@pytest.fixture def appscope(): return flaskscopes.application() -@pytest.fixture() +@pytest.fixture def reqscope(): return flaskscopes.request() -@pytest.fixture() +@pytest.fixture def flaskapp(): return flask.Flask("test") -@pytest.fixture() +@pytest.fixture def appcontext(flaskapp): return flaskapp.app_context -@pytest.fixture() +@pytest.fixture def reqcontext(flaskapp): return flaskapp.test_request_context diff --git a/tests/ext/test_wsgiscopes.py b/tests/ext/test_wsgiscopes.py index f09eb4a..7806af6 100644 --- a/tests/ext/test_wsgiscopes.py +++ b/tests/ext/test_wsgiscopes.py @@ -43,7 +43,7 @@ def target(): return closure["ret"] -@pytest.fixture() +@pytest.fixture def app_factory(): """A factory that creates test application instances.""" @@ -69,7 +69,7 @@ def view_func(func=func): return factory -@pytest.fixture() +@pytest.fixture def client_factory(): """A factory that creates test client instances.""" diff --git a/tests/test_box.py b/tests/test_box.py index 568fc9c..b506831 100644 --- a/tests/test_box.py +++ b/tests/test_box.py @@ -386,7 +386,7 @@ def __init__(self, x): assert Foo(*args, **kwargs).x == rv -@pytest.mark.asyncio() +@pytest.mark.asyncio @pytest.mark.parametrize( ("args", "kwargs", "rv"), [ @@ -508,7 +508,7 @@ def fn(a, b, c, d): assert len(fn()) == 3 -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_box_pass_optimization_async(request, boxclass): testbox = boxclass() testbox.put("a", 1) diff --git a/tests/test_stack.py b/tests/test_stack.py index a9585cb..917330b 100644 --- a/tests/test_stack.py +++ b/tests/test_stack.py @@ -500,7 +500,7 @@ def __init__(self, x): assert Foo(*args, **kwargs).x == rv -@pytest.mark.asyncio() +@pytest.mark.asyncio @pytest.mark.parametrize( ("args", "kwargs", "rv"), [ @@ -627,7 +627,7 @@ def fn(a, b, c, d): assert len(fn()) == 3 -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_stack_pass_optimization_async(request, boxclass, teststack): testbox = boxclass() testbox.put("a", 1)