Skip to content

Commit

Permalink
fix flake8 ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
anatoly-kor committed Oct 24, 2021
1 parent d2d54ff commit c760ec5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[flake8]
disable-noqa = True
ignore = E501, E265, F811, PT001, DJ05, D100, D105, D104, W503
ignore = W503
filename =
./homework.py
max-complexity = 10
Expand Down
17 changes: 11 additions & 6 deletions tests/test_homework.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ def test_InfoMessage():
info_message = homework.InfoMessage
info_message_signature = inspect.signature(info_message)
info_message_signature_list = list(info_message_signature.parameters)
for param in ['training_type', 'duration', 'distance', 'speed', 'calories']:
assert param in info_message_signature_list, (
for p in ['training_type', 'duration', 'distance', 'speed', 'calories']:
assert p in info_message_signature_list, (
'У метода `__init__` класса `InfoMessage` должен быть '
f'параметр {param}.'
f'параметр {p}.'
)


Expand Down Expand Up @@ -180,7 +180,9 @@ def test_Training_get_spent_calories(input_data):
assert hasattr(training, 'get_spent_calories'), (
'Создайте метод `get_spent_calories` в классе `Training`.'
)
assert callable(training.get_spent_calories), '`get_spent_calories` должна быть функцией.'
assert callable(training.get_spent_calories), (
'`get_spent_calories` должна быть функцией.'
)


def test_Training_show_training_info(monkeypatch):
Expand All @@ -205,7 +207,9 @@ def mock_get_spent_calories():

def test_Swimming():
assert hasattr(homework, 'Swimming'), 'Создайте класс `Swimming`'
assert inspect.isclass(homework.Swimming), '`Swimming` должен быть классом.'
assert inspect.isclass(homework.Swimming), (
'`Swimming` должен быть классом.'
)
assert issubclass(homework.Swimming, homework.Training), (
'Класс `Swimming` должен наследоваться от класса `Training`.'
)
Expand Down Expand Up @@ -299,7 +303,8 @@ def test_SportsWalking_get_spent_calories(input_data, expected):
'должен возвращать значение типа`float`'
)
assert result == expected, (
'Проверьте формулу подсчёта потраченных калорий в классе `SportsWalking`'
'Проверьте формулу подсчёта потраченных '
'калорий в классе `SportsWalking`'
)


Expand Down

0 comments on commit c760ec5

Please sign in to comment.