Skip to content

Commit 90b84a7

Browse files
committed
Fix flake8 errors
1 parent c80d399 commit 90b84a7

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ clean:
22
find src -type f -name "*.py[co]" -delete
33
find src -type d -name "__pycache__" -delete
44

5+
lint: clean
6+
flake8 src/newsfeed tests
7+
mypy -p newsfeed
8+
59
test: clean
610
py.test tests/unit --cov=src/
711

812
integration-test:
913
python scripts/integration_check.py
1014
echo "Tests passed"
1115

12-
lint: clean
13-
flake8 src/newsfeed tests
14-
mypy -p newsfeed

setup.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[flake8]
22
max_line_length = 120
33
max_complexity = 10
4+
ignore = D101,D102,D103
5+
exclude = tests/api/*
46

57
[mypy]
68
mypy_path = src/

src/newsfeed/domain/error.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33

44
class DomainError(Exception):
5-
"""Domain error."""
65

76
@property
87
def message(self) -> str:
9-
"""Return error message."""
10-
return f'Domain error'
8+
return 'Domain error'

src/newsfeed/domain/subscription.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, List, Tuple, Any
5+
from typing import Dict, List, Tuple, Any
66
from uuid import UUID, uuid4
77
from datetime import datetime
88

tests/unit/webapi/handlers/test_events.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ async def test_post_events(web_client, container):
9494
async def test_post_event_with_abnormally_long_newsfeed_id(web_client, container):
9595
"""Check events posting handler."""
9696
newsfeed_id_max_length = container.newsfeed_id_specification().max_length
97-
newsfeed_id = 'x'*(newsfeed_id_max_length + 1)
97+
newsfeed_id = 'x' * (newsfeed_id_max_length + 1)
9898

9999
response = await web_client.post(
100100
f'/newsfeed/{newsfeed_id}/events/',

tests/unit/webapi/handlers/test_subscriptions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ async def test_post_subscription_to_self(web_client, container):
9696
async def test_post_subscription_with_abnormally_long_newsfeed_id(web_client, container):
9797
"""Check subscriptions posting handler."""
9898
newsfeed_id_max_length = container.newsfeed_id_specification().max_length
99-
newsfeed_id = 'x'*(newsfeed_id_max_length + 1)
99+
newsfeed_id = 'x' * (newsfeed_id_max_length + 1)
100100

101101
response = await web_client.post(
102102
f'/newsfeed/{newsfeed_id}/subscriptions/',
@@ -121,7 +121,7 @@ async def test_post_subscription_with_abnormally_long_to_newsfeed_id(web_client,
121121
newsfeed_id = '124'
122122

123123
newsfeed_id_max_length = container.newsfeed_id_specification().max_length
124-
to_newsfeed_id = 'x'*(newsfeed_id_max_length + 1)
124+
to_newsfeed_id = 'x' * (newsfeed_id_max_length + 1)
125125

126126
response = await web_client.post(
127127
f'/newsfeed/{newsfeed_id}/subscriptions/',

0 commit comments

Comments
 (0)