Answer the question
In order to leave comments, you need to log in
How to prioritize fixtures in pytest or not run fixture for last test?
Greetings.
Such a problem, you need to start the browser once at the beginning of the tests, close it at the end of all tests.
But we need a separate fixture that will be executed after each function - deleting all cookies.
Now it turns out that after the last test, the global fixture with the
Scope = 'session' setting is triggered and closes the browser. the fixture with the Scope ='function'
setting does not have time to work out, cookies are not deleted, and a bunch of errors fall.
In general, in the last test it is not needed at all, is it possible to somehow configure it so that the fixture does not work in the last test?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question