Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Method name doesn't conform to snake_case naming style

I’m creating a simple project with my pylintrc file and get this error for the test method:

method name - test_calculator_add_method_returns_correct_result -  doesn't conform to snake_case naming style
class TddInPythonExample(unittest.TestCase):
    """ This is a basic test class"""

    def test_calculator_add_method_returns_correct_result(self):
        """ This test the calculator add method """
        calc = Calculator()
        result = calc.add(2,2)
        self.assertEqual(4, result)
like image 933
user1050619 Avatar asked May 20 '18 10:05

user1050619


Video Answer


1 Answers

Why is the method name rejected

It appears according to this: http://pylint-messages.wikidot.com/messages:c0103 that the length of the name is capped at 30 characters, where your method name is 49 characters long

The fix

You can shorten the method name, or change your config to allow longer methods

like image 159
jrtapsell Avatar answered Sep 18 '22 08:09

jrtapsell