Remove all "WPS" codes
This commit is contained in:
parent
8a5a652b3e
commit
9fcb3c8c14
1 changed files with 171 additions and 254 deletions
|
|
@ -27,7 +27,7 @@ class TestAggregateOrders:
|
|||
"""
|
||||
mock = mocker.Mock()
|
||||
query = ( # noqa:ECE001
|
||||
mock.query.return_value.join.return_value.filter.return_value.all # noqa:E501,WPS219
|
||||
mock.query.return_value.join.return_value.filter.return_value.all # noqa:E501
|
||||
)
|
||||
monkeypatch.setattr(db, 'session', mock)
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ class TestAggregateOrders:
|
|||
def test_no_orders(self, db_session, one_pixel_grid, restaurant):
|
||||
"""Edge case that does not occur for real-life data."""
|
||||
db_session.commit()
|
||||
assert len(restaurant.orders) == 0 # noqa:WPS507 sanity check
|
||||
assert len(restaurant.orders) == 0 # sanity check
|
||||
|
||||
oh = timify.OrderHistory(
|
||||
grid=one_pixel_grid,
|
||||
|
|
@ -63,7 +63,7 @@ class TestAggregateOrders:
|
|||
|
||||
result = oh.aggregate_orders()
|
||||
|
||||
assert len(result) == 0 # noqa:WPS507
|
||||
assert len(result) == 0
|
||||
|
||||
def test_evenly_distributed_ad_hoc_orders(
|
||||
self,
|
||||
|
|
@ -99,7 +99,7 @@ class TestAggregateOrders:
|
|||
assert result['n_orders'].max() == 1
|
||||
assert result['n_orders'].sum() == 12
|
||||
|
||||
def test_evenly_distributed_ad_hoc_orders_with_no_demand_late( # noqa:WPS218
|
||||
def test_evenly_distributed_ad_hoc_orders_with_no_demand_late(
|
||||
self,
|
||||
db_session,
|
||||
one_pixel_grid,
|
||||
|
|
@ -212,7 +212,7 @@ class TestAggregateOrders:
|
|||
assert result['n_orders'].max() == 1
|
||||
assert result['n_orders'].sum() == 1
|
||||
|
||||
def test_evenly_distributed_ad_hoc_orders_with_half_hour_time_steps( # noqa:WPS218
|
||||
def test_evenly_distributed_ad_hoc_orders_with_half_hour_time_steps(
|
||||
self,
|
||||
db_session,
|
||||
one_pixel_grid,
|
||||
|
|
@ -273,7 +273,7 @@ class TestAggregateOrders:
|
|||
db_session.add(order)
|
||||
|
||||
# Create one order every other hour and 6 orders in total.
|
||||
for hour in range(11, 23, 2): # noqa:WPS440
|
||||
for hour in range(11, 23, 2):
|
||||
order = make_order(
|
||||
scheduled=False,
|
||||
restaurant=restaurant,
|
||||
|
|
@ -281,7 +281,7 @@ class TestAggregateOrders:
|
|||
test_config.YEAR,
|
||||
test_config.MONTH,
|
||||
test_config.DAY + 1,
|
||||
hour, # noqa:WPS441
|
||||
hour,
|
||||
11,
|
||||
),
|
||||
)
|
||||
|
|
@ -305,7 +305,7 @@ class TestAggregateOrders:
|
|||
assert result['n_orders'].sum() == 18
|
||||
|
||||
@pytest.fixture
|
||||
def two_pixel_grid( # noqa:WPS211
|
||||
def two_pixel_grid(
|
||||
self,
|
||||
db_session,
|
||||
city,
|
||||
|
|
@ -336,7 +336,7 @@ class TestAggregateOrders:
|
|||
|
||||
return grid
|
||||
|
||||
def test_two_pixels_with_shifted_orders( # noqa:WPS218
|
||||
def test_two_pixels_with_shifted_orders(
|
||||
self,
|
||||
db_session,
|
||||
two_pixel_grid,
|
||||
|
|
@ -361,7 +361,7 @@ class TestAggregateOrders:
|
|||
db_session.add(order)
|
||||
|
||||
# Create two orders per hour for `restaurant2`.
|
||||
for hour in range(11, 23): # noqa:WPS440
|
||||
for hour in range(11, 23):
|
||||
order = make_order(
|
||||
scheduled=False,
|
||||
restaurant=restaurant2,
|
||||
|
|
@ -369,7 +369,7 @@ class TestAggregateOrders:
|
|||
test_config.YEAR,
|
||||
test_config.MONTH,
|
||||
test_config.DAY,
|
||||
hour, # noqa:WPS441
|
||||
hour,
|
||||
13,
|
||||
),
|
||||
)
|
||||
|
|
@ -382,7 +382,7 @@ class TestAggregateOrders:
|
|||
test_config.YEAR,
|
||||
test_config.MONTH,
|
||||
test_config.DAY,
|
||||
hour, # noqa:WPS441
|
||||
hour,
|
||||
14,
|
||||
),
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue