How can i pass setup args to pytest testmethod decorator/fixtures

43 Views Asked by At
class TestXYZ:


    @pytest.fixture(scope="function", autouse=True)
    def setup(self, before_function, after_function, test_details):
        self.cluster_details, self.account_details, self.application_details, self.testrail_details = test_details

    @my_decorator(('arg1','arg2'))
    def test_1495990_verify_sensor_device_status(self,print_arguments): 
        """
        Step 1 :: Precondition
        - Adding Device to workspace
        """
        print('test started')

In @my_decorator (it takes the args and performs some operation) how can I pass setup variables such as self.cluster_details and self.account_details instead of 'arg1' and 'arg2' ?

0

There are 0 best solutions below