Reputation: 12837
I'm having a pytest run that invokes N tests. I want all tests to output into the same log, and I want to clear the log before pytest is triggered, so different runs would not contiminate each other. So far, I tried adding my clear_log()
to some fixtures or hooks, but none has achieved what In wanted - or they were called each time (pytest_runtest_makereport
for example), or they were not called at all (some function that was decorated with pytest.fixture()
I also tried having a global flag that would indicate if this is the first run, but it didn't work either...
Where can I put the function so it would be invoked only once?
Upvotes: 3
Views: 2749