I am trying to call a function to use it result in parametrize. I use fixtures in this function and when I call it at the class level, I see an error. My code:
def subscriber_groups_ID(self, init_http_session, init_util):
# get sub group
response = init_http_session.get("/api/subscriberGroups", headers={"Authorization": init_util.auth_main_token()})
subcriberGroupID = response.json()["subscriberGroups"][0]["subscriberGroupID"]
return subcriberGroupID
subscriberGroupID = subscriber_groups_ID()
json = [
({ "subscriberGroupID": subscriberGroupID, "subscriberTariffTypeID": "0"}),
({ "subscriberGroupID": subscriberGroupID, "subscriberTariffTypeID": Util.generate_tariff(Util)})
]
and error
TypeError: TestSubscribers.subscriber_groups_ID() missing 3 required positional arguments: 'self', 'init_http_session', and 'init_util'
Whats wrong and how to call it correct?
I try to use other ways and make this function in Utils class, but it not helps
You called it with zero arguments.
Call it with
self, and then whateverinit_http_sessionandinit_utilyou have.