Skip to content

Commit

Permalink
Update Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Aug 18, 2024
1 parent afc536b commit bea7691
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
- id: black

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.6
rev: v0.6.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
2 changes: 1 addition & 1 deletion tests/integrations/test_aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _app(registry):
return svcs.aiohttp.init_app(Application(), registry=registry)


@pytest.mark.asyncio()
@pytest.mark.asyncio
class TestAIOHTTP:
async def test_aclose_registry_ok(self, app, close_me):
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/integrations/test_fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
pytest.skip("FastAPI not installed", allow_module_level=True)


@pytest.mark.asyncio()
@pytest.mark.asyncio
@pytest.mark.parametrize("yield_something", [True, False])
@pytest.mark.parametrize("cm", [True, False])
async def test_integration(yield_something, cm):
Expand Down
2 changes: 1 addition & 1 deletion tests/integrations/test_flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def test_get_pingeable(self, app):
ping._svc_type for ping in svcs.flask.get_pings()
]

@pytest.mark.asyncio()
@pytest.mark.asyncio
async def test_teardown_warns_on_async_on_close(self, container):
"""
teardown() warns if there are async cleanups.
Expand Down
4 changes: 2 additions & 2 deletions tests/integrations/test_starlette.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
pytest.skip("Starlette not installed", allow_module_level=True)


@pytest.mark.asyncio()
@pytest.mark.asyncio
@pytest.mark.parametrize("yield_something", [True, False])
@pytest.mark.parametrize("cm", [True, False])
async def test_integration(yield_something, cm):
Expand Down Expand Up @@ -110,7 +110,7 @@ async def healthy(request):
)


@pytest.mark.asyncio()
@pytest.mark.asyncio
async def test_get_pings(registry, container):
"""
Our get_pings returns registered pings.
Expand Down
6 changes: 3 additions & 3 deletions tests/test_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_get_pings_empty(self, container):
"""
assert [] == container.get_pings()

@pytest.mark.asyncio()
@pytest.mark.asyncio
async def test_repr(self, registry, container):
"""
The repr counts correctly.
Expand Down Expand Up @@ -74,7 +74,7 @@ def factory():

assert close_me.is_closed

@pytest.mark.asyncio()
@pytest.mark.asyncio
async def test_async_context_manager(self, container, close_me):
"""
The container is also an async context manager that acloses on exit.
Expand Down Expand Up @@ -109,7 +109,7 @@ def scope():
"Container was garbage-collected with pending cleanups.",
) == recwarn.list[0].message.args

@pytest.mark.asyncio()
@pytest.mark.asyncio
async def test_aget_enters_sync_contextmanagers(self, container):
"""
aget enters (and exits) synchronous context managers.
Expand Down
4 changes: 2 additions & 2 deletions tests/test_fake_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ def test_str_cleanup_factory():
next(gen)


@pytest.mark.asyncio()
@pytest.mark.asyncio
async def test_async_int_factory():
"""
async_int_factory takes no arguments and returns an int.
"""
assert isinstance(await async_int_factory(), int)


@pytest.mark.asyncio()
@pytest.mark.asyncio
async def test_async_str_cleanup_factory():
"""
async_str_cleanup_factory takes no arguments and returns an async generator
Expand Down
4 changes: 2 additions & 2 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def test_local_registry_is_lazy_but_only_once(container):
assert reg is container._lazy_local_registry


@pytest.mark.asyncio()
@pytest.mark.asyncio
class TestAsync:
async def test_async_factory(self, registry, container):
"""
Expand Down Expand Up @@ -421,7 +421,7 @@ async def factory():
assert not container._instantiated
assert not container._on_close

@pytest.mark.asyncio()
@pytest.mark.asyncio
async def test_aclose_resilient(
self, container, registry, caplog, close_me
):
Expand Down
10 changes: 5 additions & 5 deletions tests/test_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_generators_become_context_managers(self, registry):
with cm():
...

@pytest.mark.asyncio()
@pytest.mark.asyncio
async def test_async_generators_become_context_managers(self, registry):
"""
If a generator-based factory is passed, it's automatically wrapped with
Expand Down Expand Up @@ -198,7 +198,7 @@ def test_context_manager(self):

orc.assert_called_once_with()

@pytest.mark.asyncio()
@pytest.mark.asyncio
async def test_async_context_manager(self, close_me):
"""
The registry is also an async context manager that acloses on exit.
Expand All @@ -220,7 +220,7 @@ async def closer():
not hasattr(contextlib, "aclosing"),
reason="Hasn't contextlib.aclosing()",
)
@pytest.mark.asyncio()
@pytest.mark.asyncio
async def test_async_empty_close(self, registry):
"""
Asynchronously closing an empty registry does nothing.
Expand All @@ -230,7 +230,7 @@ async def test_async_empty_close(self, registry):
async with svcs.Registry():
...

@pytest.mark.asyncio()
@pytest.mark.asyncio
@needs_working_async_mock
async def test_aclose_mixed(self, registry):
"""
Expand All @@ -252,7 +252,7 @@ async def test_aclose_mixed(self, registry):

async_close.assert_awaited_once()

@pytest.mark.asyncio()
@pytest.mark.asyncio
@needs_working_async_mock
async def test_aclose_logs_failures(self, registry, caplog):
"""
Expand Down

0 comments on commit bea7691

Please sign in to comment.