Remove the config of flake8-expression-complexity
This commit is contained in:
parent
b24eb80f70
commit
137b3b1e03
7 changed files with 13 additions and 13 deletions
|
|
@ -24,7 +24,7 @@ config = configuration.make_config('testing' if os.getenv('TESTING') else 'produ
|
||||||
def upgrade():
|
def upgrade():
|
||||||
"""Upgrade to revision f11cd76d2f45."""
|
"""Upgrade to revision f11cd76d2f45."""
|
||||||
op.execute(f'CREATE SCHEMA {config.CLEAN_SCHEMA};')
|
op.execute(f'CREATE SCHEMA {config.CLEAN_SCHEMA};')
|
||||||
op.create_table( # noqa:ECE001
|
op.create_table(
|
||||||
'cities',
|
'cities',
|
||||||
sa.Column('id', sa.SmallInteger(), autoincrement=False, nullable=False),
|
sa.Column('id', sa.SmallInteger(), autoincrement=False, nullable=False),
|
||||||
sa.Column('name', sa.Unicode(length=10), nullable=False),
|
sa.Column('name', sa.Unicode(length=10), nullable=False),
|
||||||
|
|
@ -52,7 +52,7 @@ def upgrade():
|
||||||
),
|
),
|
||||||
schema=config.CLEAN_SCHEMA,
|
schema=config.CLEAN_SCHEMA,
|
||||||
)
|
)
|
||||||
op.create_table( # noqa:ECE001
|
op.create_table(
|
||||||
'couriers',
|
'couriers',
|
||||||
sa.Column('id', sa.Integer(), autoincrement=False, nullable=False),
|
sa.Column('id', sa.Integer(), autoincrement=False, nullable=False),
|
||||||
sa.Column('created_at', sa.DateTime(), nullable=False),
|
sa.Column('created_at', sa.DateTime(), nullable=False),
|
||||||
|
|
@ -103,7 +103,7 @@ def upgrade():
|
||||||
sa.PrimaryKeyConstraint('id', name=op.f('pk_customers')),
|
sa.PrimaryKeyConstraint('id', name=op.f('pk_customers')),
|
||||||
schema=config.CLEAN_SCHEMA,
|
schema=config.CLEAN_SCHEMA,
|
||||||
)
|
)
|
||||||
op.create_table( # noqa:ECE001
|
op.create_table(
|
||||||
'addresses',
|
'addresses',
|
||||||
sa.Column('id', sa.Integer(), autoincrement=False, nullable=False),
|
sa.Column('id', sa.Integer(), autoincrement=False, nullable=False),
|
||||||
sa.Column('primary_id', sa.Integer(), nullable=False),
|
sa.Column('primary_id', sa.Integer(), nullable=False),
|
||||||
|
|
@ -190,7 +190,7 @@ def upgrade():
|
||||||
unique=False,
|
unique=False,
|
||||||
schema=config.CLEAN_SCHEMA,
|
schema=config.CLEAN_SCHEMA,
|
||||||
)
|
)
|
||||||
op.create_table( # noqa:ECE001
|
op.create_table(
|
||||||
'restaurants',
|
'restaurants',
|
||||||
sa.Column('id', sa.SmallInteger(), autoincrement=False, nullable=False),
|
sa.Column('id', sa.SmallInteger(), autoincrement=False, nullable=False),
|
||||||
sa.Column('created_at', sa.DateTime(), nullable=False),
|
sa.Column('created_at', sa.DateTime(), nullable=False),
|
||||||
|
|
@ -231,7 +231,7 @@ def upgrade():
|
||||||
unique=False,
|
unique=False,
|
||||||
schema=config.CLEAN_SCHEMA,
|
schema=config.CLEAN_SCHEMA,
|
||||||
)
|
)
|
||||||
op.create_table( # noqa:ECE001
|
op.create_table(
|
||||||
'orders',
|
'orders',
|
||||||
sa.Column('id', sa.Integer(), autoincrement=False, nullable=False),
|
sa.Column('id', sa.Integer(), autoincrement=False, nullable=False),
|
||||||
sa.Column('delivery_id', sa.Integer(), nullable=True),
|
sa.Column('delivery_id', sa.Integer(), nullable=True),
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,7 @@ class AdHocOrderFactory(alchemy.SQLAlchemyModelFactory):
|
||||||
(obj.delivery_address.latitude, obj.delivery_address.longitude),
|
(obj.delivery_address.latitude, obj.delivery_address.longitude),
|
||||||
).meters,
|
).meters,
|
||||||
)
|
)
|
||||||
logged_avg_speed = factory.LazyAttribute( # noqa:ECE001
|
logged_avg_speed = factory.LazyAttribute(
|
||||||
lambda obj: round(
|
lambda obj: round(
|
||||||
(
|
(
|
||||||
obj.logged_avg_speed_distance
|
obj.logged_avg_speed_distance
|
||||||
|
|
|
||||||
|
|
@ -393,7 +393,7 @@ class TestSyncWithGoogleMaps:
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def api_response(self):
|
def api_response(self):
|
||||||
"""A typical (shortened) response by the Google Maps Directions API."""
|
"""A typical (shortened) response by the Google Maps Directions API."""
|
||||||
return [ # noqa:ECE001
|
return [
|
||||||
{
|
{
|
||||||
'bounds': {
|
'bounds': {
|
||||||
'northeast': {'lat': 44.8554284, 'lng': -0.5652398},
|
'northeast': {'lat': 44.8554284, 'lng': -0.5652398},
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ class TestGridification:
|
||||||
all considered `Order.pickup_address` attributes for some orders.
|
all considered `Order.pickup_address` attributes for some orders.
|
||||||
"""
|
"""
|
||||||
mock = mocker.Mock()
|
mock = mocker.Mock()
|
||||||
query = ( # noqa:ECE001
|
query = (
|
||||||
mock.query.return_value.join.return_value.filter.return_value.all # noqa:E501
|
mock.query.return_value.join.return_value.filter.return_value.all # noqa:E501
|
||||||
)
|
)
|
||||||
monkeypatch.setattr(db, 'session', mock)
|
monkeypatch.setattr(db, 'session', mock)
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ class TestProperties:
|
||||||
def _restaurants_mock(self, mocker, monkeypatch, restaurant):
|
def _restaurants_mock(self, mocker, monkeypatch, restaurant):
|
||||||
"""A `Mock` whose `.return_value` is `[restaurant]`."""
|
"""A `Mock` whose `.return_value` is `[restaurant]`."""
|
||||||
mock = mocker.Mock()
|
mock = mocker.Mock()
|
||||||
query = ( # noqa:ECE001
|
query = (
|
||||||
mock.query.return_value.join.return_value.filter.return_value.all # noqa:E501
|
mock.query.return_value.join.return_value.filter.return_value.all # noqa:E501
|
||||||
)
|
)
|
||||||
query.return_value = [restaurant]
|
query.return_value = [restaurant]
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ class TestAggregateOrders:
|
||||||
Note: This fixture also exists in `tests.db.test_grids`.
|
Note: This fixture also exists in `tests.db.test_grids`.
|
||||||
"""
|
"""
|
||||||
mock = mocker.Mock()
|
mock = mocker.Mock()
|
||||||
query = ( # noqa:ECE001
|
query = (
|
||||||
mock.query.return_value.join.return_value.filter.return_value.all # noqa:E501
|
mock.query.return_value.join.return_value.filter.return_value.all # noqa:E501
|
||||||
)
|
)
|
||||||
monkeypatch.setattr(db, 'session', mock)
|
monkeypatch.setattr(db, 'session', mock)
|
||||||
|
|
|
||||||
|
|
@ -105,17 +105,17 @@ class TestChooseTacticalModel:
|
||||||
data.loc[:, 'n_orders'] = 1
|
data.loc[:, 'n_orders'] = 1
|
||||||
|
|
||||||
# ... and we set three additional time steps per day to `0`.
|
# ... and we set three additional time steps per day to `0`.
|
||||||
data.loc[ # noqa:ECE001
|
data.loc[
|
||||||
# all `Pixel`s, all `Order`s in time steps starting at 11 am
|
# all `Pixel`s, all `Order`s in time steps starting at 11 am
|
||||||
(slice(None), slice(data.index.levels[1][0], None, 12)),
|
(slice(None), slice(data.index.levels[1][0], None, 12)),
|
||||||
'n_orders',
|
'n_orders',
|
||||||
] = 0
|
] = 0
|
||||||
data.loc[ # noqa:ECE001
|
data.loc[
|
||||||
# all `Pixel`s, all `Order`s in time steps starting at 12 am
|
# all `Pixel`s, all `Order`s in time steps starting at 12 am
|
||||||
(slice(None), slice(data.index.levels[1][1], None, 12)),
|
(slice(None), slice(data.index.levels[1][1], None, 12)),
|
||||||
'n_orders',
|
'n_orders',
|
||||||
] = 0
|
] = 0
|
||||||
data.loc[ # noqa:ECE001
|
data.loc[
|
||||||
# all `Pixel`s, all `Order`s in time steps starting at 1 pm
|
# all `Pixel`s, all `Order`s in time steps starting at 1 pm
|
||||||
(slice(None), slice(data.index.levels[1][2], None, 12)),
|
(slice(None), slice(data.index.levels[1][2], None, 12)),
|
||||||
'n_orders',
|
'n_orders',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue