Skip to content

Commit

Permalink
Update Ruff to 0.6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ikalnytskyi committed Aug 15, 2024
1 parent 0d3f993 commit b6201e2
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 21 deletions.
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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"]
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions tests/ext/test_asgiscopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand Down Expand Up @@ -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."""

Expand All @@ -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."""

Expand Down Expand Up @@ -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()
Expand Down
10 changes: 5 additions & 5 deletions tests/ext/test_flaskscopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/ext/test_wsgiscopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def target():
return closure["ret"]


@pytest.fixture()
@pytest.fixture
def app_factory():
"""A factory that creates test application instances."""

Expand All @@ -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."""

Expand Down
4 changes: 2 additions & 2 deletions tests/test_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
[
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
[
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b6201e2

Please sign in to comment.