Class method setUpClass should have 'cls' as first argument
4class Test_TestAPI(unittest.TestCase):
5
6 @classmethod
7 def setUpClass(self): 8 self.conn = http.client.HTTPConnection("localhost:3000")
9
10
Description
It is recommended to name the first argument of a classmethod as cls
so that it's easy to differentiate them from regular instance methods.
Bad practice
class SpaceShip:
@classmethod
def trajectory(self, x, y, z): # `self` here can be very confusing
...
Recommended
class SpaceShip:
@classmethod
def trajectory(cls, x, y, z):
...