Closed bradgrimm closed 8 years ago
Have you seen the looponfail
flag? It might accomplish what you are asking:
@alfredodeza I had seen that option. I was under the impression it was running all the tests again. I have some big files that take a while to run, and I often have a small subset that fail. It is nice to go through and address those tests, and then just rerun that small subset (since it is a big file). Am I misunderstanding loop on fail?
Oh I see what you are saying, you want just the subset. So looponfail
would only work for your use case if you are working on a single test not a whole set like say, in a class (unless you don't mind waiting for all of them to pass/fail).
Even though we may know what tests failed I am afraid approaching this is very tricky and not sure if possible. When tests fail, the plugin knows about paths, line numbers, exception name, and traceback. If you are running tests, like in a whole file (:Pytest file
) it would be hard to re-run all the ones that failed because the plugin would need to run them one by one.
The plugin can run file, class, method, function, and project, but it does that by calling py.test
once. There is currently no way to (in a single call) to run one test from class A, another one from class B, and another one in some function.
Since the plugin already stores out all the failed tests it would be nice to have a new parameter that allows only re-running the failures. Something like:
:Pytest failures