'Difference between Non-Static Method without self and static method?

My unittests kept failing with a quite unspecific error without a line or additional information:

In  testMainInno (main.MainTestCases) :

 TypeError: testMainInno() missing 1 required positional argument: 'dbname'

Fortunately this method is only called a single time:

class MainTests(unittest.TestCase):
    def setUp(self):
        mtc.testMainInno(self.defaultDBName)

Which refers to this class with the following method:

class MainTestCases(unittest.TestCase):    
    @staticmethod
    def testMainInno(dbname):
        #doStuff

I decided to declare testMainInno as a static method as it doesn't require anything from the class and I see no purpose in adding self.

The error is especially weird as it seems the method is executed properly, I can debug it and the pdb goes into it, executing everything. I decided to remove the @staticmethod-Decorator and the error is gone.

I am now a little puzzled as I am used to getting errors when I declare non-static methods that imply a usage of self. And even if it wouldn't, what kind of error is it that doesn't have any effect as everything gets executed as planned?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source