Sample code:
class CollectorPlugin:
def __init__(self, group_name):
self.group_name = group_name
self.collected = []
@pytest.fixture
def capture_logs(self, request):
#self is an instance of test_method1 NOT of CollectorPlugin?
print(self.group_name)
collector_plugin = CollectorPlugin("test")
returncode = pytest.main(
args,
plugins=[collector_plugin]
)
def test_method1(capture_logs):
assert True
The capture_logs fixture can't seem to access the plugin's instance object self.
How can I pass some data to the fixture from the plugin?