I have a code as shown below. When I start, I get an error of too few args . I do not call setup_class explicitly, so I'm not sure how to pass any parameter to it. I tried to decorate the @classmethod method, but still see the same error.
The error I see is E TypeError: setup_class() takes exactly 2 arguments (1 given)
One remark - if I do not pass any parameter to the class and do not pass only cls , then I do not see an error.
Any help is greatly appreciated.
I looked through these questions, question number 1 and question number 2 before publication. I did not understand the solutions sent to these questions, or how they will work.
class A_Helper: def __init__(self, fixture): print "In class A_Helper" def some_method_in_a_helper(self): print "foo" class Test_class: def setup_class(cls, fixture): print "!!! In setup class !!!" cls.a_helper = A_Helper(fixture) def test_some_method(self): self.a_helper.some_method_in_a_helper() assert 0 == 0
source share