I followed the answer here and solved my problem of accessing class instance variables in a pytest class by setting them through autouse fixtures.
autouse
Code: