Enable RUF in ruff
This commit is contained in:
parent
ae2dc8db64
commit
c56fe649b7
6 changed files with 26 additions and 17 deletions
|
|
@ -44,7 +44,7 @@ def test_two_pixels_with_two_addresses(
|
|||
side_length = max(city.total_x // 2, city.total_y // 2) + 1
|
||||
|
||||
# Hack the configuration regarding the grids to be created.
|
||||
monkeypatch.setattr(velofy.config, "GRID_SIDE_LENGTHS", [side_length])
|
||||
monkeypatch.setattr(velofy.config, "GRID_SIDE_LENGTHS", (side_length,))
|
||||
|
||||
result = cli.invoke(gridify.gridify)
|
||||
|
||||
|
|
|
|||
|
|
@ -83,9 +83,7 @@ class TestGridification:
|
|||
all considered `Order.pickup_address` attributes for some orders.
|
||||
"""
|
||||
mock = mocker.Mock()
|
||||
query = (
|
||||
mock.query.return_value.join.return_value.filter.return_value.all # noqa:E501
|
||||
)
|
||||
query = mock.query.return_value.join.return_value.filter.return_value.all
|
||||
monkeypatch.setattr(db, "session", mock)
|
||||
|
||||
return query
|
||||
|
|
|
|||
|
|
@ -1150,7 +1150,7 @@ class TestProperties:
|
|||
|
||||
@pytest.mark.db
|
||||
@pytest.mark.no_cover
|
||||
def test_make_random_orders( # noqa:C901
|
||||
def test_make_random_orders(
|
||||
db_session,
|
||||
make_address,
|
||||
make_courier,
|
||||
|
|
|
|||
|
|
@ -121,9 +121,7 @@ class TestProperties:
|
|||
def _restaurants_mock(self, mocker, monkeypatch, restaurant):
|
||||
"""A `Mock` whose `.return_value` is `[restaurant]`."""
|
||||
mock = mocker.Mock()
|
||||
query = (
|
||||
mock.query.return_value.join.return_value.filter.return_value.all # noqa:E501
|
||||
)
|
||||
query = mock.query.return_value.join.return_value.filter.return_value.all
|
||||
query.return_value = [restaurant]
|
||||
monkeypatch.setattr(db, "session", mock)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
"""Tests for the `velofy.forecasts.models` sub-package."""
|
||||
|
||||
import typing as t
|
||||
|
||||
import pandas as pd
|
||||
import pytest
|
||||
|
||||
|
|
@ -45,7 +47,7 @@ class TestGenericForecastingModelProperties:
|
|||
|
||||
assert isinstance(result, str)
|
||||
|
||||
unique_model_names = set()
|
||||
unique_model_names: t.ClassVar[set[str]] = set()
|
||||
|
||||
def test_each_model_has_a_unique_name(self, model_cls, order_history):
|
||||
"""The `*Model.name` values must be unique across all `*Model`s.
|
||||
|
|
|
|||
|
|
@ -26,9 +26,7 @@ class TestAggregateOrders:
|
|||
Note: This fixture also exists in `tests.db.test_grids`.
|
||||
"""
|
||||
mock = mocker.Mock()
|
||||
query = (
|
||||
mock.query.return_value.join.return_value.filter.return_value.all # noqa:E501
|
||||
)
|
||||
query = mock.query.return_value.join.return_value.filter.return_value.all
|
||||
monkeypatch.setattr(db_session, "query", mock.query)
|
||||
|
||||
return query
|
||||
|
|
|
|||
Loading…
Reference in a new issue