diff --git a/.codeclimate.yml b/.codeclimate.yml index a5d507675ef..8e9c8cac813 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -1,5 +1,5 @@ --- -version: "2" # required to adjust maintainability checks +version: "2" # required to adjust maintainability checks checks: import-error: @@ -8,12 +8,9 @@ checks: enabled: false no-name-in-module: enabled: false - # Per-Language Mass Threshold Defaults - # https://docs.codeclimate.com/docs/duplication#section-understand-the-engine similar-code: config: - threshold: 68 #overriding will affect all languages + threshold: 68 identical-code: config: - threshold: 32 #overriding will affect all languages -# ... CONFIG CONTENT ... \ No newline at end of file + threshold: 32 diff --git a/.yamllint.yaml b/.yamllint.yaml index 84789e6067c..e9d3a5d49a5 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -15,13 +15,9 @@ rules: brackets: enable colons: enable commas: enable - comments: - level: warning - comments-indentation: - level: warning - document-end: disable - document-start: - level: warning + comments: disable + comments-indentation: disable + document-start: disable empty-lines: enable empty-values: disable float-values: disable diff --git a/kyu_6/a_rule_of_divisibility_by_13/test_thirt.py b/kyu_6/a_rule_of_divisibility_by_13/test_thirt.py index 89444fb387d..9449e02832d 100644 --- a/kyu_6/a_rule_of_divisibility_by_13/test_thirt.py +++ b/kyu_6/a_rule_of_divisibility_by_13/test_thirt.py @@ -1,5 +1,6 @@ """ -Test for -> A Rule of Divisibility by 13 +Test for -> A Rule of Divisibility by 13. + Created by Egor Kostan. GitHub: https://github.com/ikostan """ @@ -8,6 +9,7 @@ import unittest import allure +from parameterized import parameterized from kyu_6.a_rule_of_divisibility_by_13.thirt import thirt from utils.log_func import print_log @@ -23,14 +25,21 @@ url='https://www.codewars.com/kata/564057bc348c7200bd0000ff', name='Source/Kata') class ThirtTestCase(unittest.TestCase): - """ - Testing 'thirt' function - """ + """Testing 'thirt' function.""" + @parameterized.expand([ + (1234567, 87), + (321, 48), + (8529, 79), + (85299258, 31), + (5634, 57), + (1111111111, 71), + (987654321, 30)]) # pylint: disable-msg=R0801 - def test_thirt(self): + def test_thirt(self, n, expected): """ - Testing 'thirt' function with various test data + Testing 'thirt' function with various test data. + :return: """ allure.dynamic.title("Testing 'thirt' function") @@ -44,26 +53,12 @@ def test_thirt(self): "on an integer n (>=0). 'thirt' should return the stationary" " number.

") # pylint: enable-msg=R0801 - test_data: tuple = ( - (1234567, 87), - (321, 48), - (8529, 79), - (85299258, 31), - (5634, 57), - (1111111111, 71), - (987654321, 30)) - - for n, expected in test_data: - actual_result = thirt(n) - # pylint: disable-msg=R0801 - with allure.step(f"Enter a n ({n}) and verify the " - f"expected output ({expected}) vs " - f"actual result ({actual_result})"): - - print_log(n=n, - expected=expected, - result=actual_result) - self.assertEqual(expected, - actual_result) + actual_result = thirt(n) + # pylint: disable-msg=R0801 + with allure.step(f"Enter a n ({n}) and verify the " + f"expected output ({expected}) vs " + f"actual result ({actual_result})"): + print_log(n=n, expected=expected, result=actual_result) + self.assertEqual(expected, actual_result) # pylint: enable-msg=R0801