From c760ec5cf297050bd0340d1a7897d2d800339121 Mon Sep 17 00:00:00 2001 From: Anatoly Korobov Date: Sun, 24 Oct 2021 13:47:57 +0300 Subject: [PATCH] fix flake8 ignore --- setup.cfg | 2 +- tests/test_homework.py | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/setup.cfg b/setup.cfg index eb959c322..d2ecd230d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/tests/test_homework.py b/tests/test_homework.py index 4da8f0f66..66dae14ef 100644 --- a/tests/test_homework.py +++ b/tests/test_homework.py @@ -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}.' ) @@ -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): @@ -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`.' ) @@ -299,7 +303,8 @@ def test_SportsWalking_get_spent_calories(input_data, expected): 'должен возвращать значение типа`float`' ) assert result == expected, ( - 'Проверьте формулу подсчёта потраченных калорий в классе `SportsWalking`' + 'Проверьте формулу подсчёта потраченных ' + 'калорий в классе `SportsWalking`' )