Attribute 'vars' defined outside __init__
14class TestCheckbox():
15 def setup_method(self, method):
16 self.driver = webdriver.Chrome()
17 self.vars = {}18
19 def teardown_method(self, method):
20 self.driver.quit()
Attribute 'driver' defined outside __init__
13
14class TestCheckbox():
15 def setup_method(self, method):
16 self.driver = webdriver.Chrome()17 self.vars = {}
18
19 def teardown_method(self, method):
Description
Defining an instance attribute outside __init__
affects the readability of code. It is expected to find all the attributes an instance may have by reading its __init__
method. If there is a need to initialize attribute via sub-initialization methods, it is recommended to assign attributes to None
in the init then call the sub-initialization methods.