Open mottosso opened 4 years ago
api.register_setup_teardown(MyTeardown)
Would this be better with api.register_teardown_plugin(MyTeardown)
?
Oh, yes, you're right. Typo.
Instead of registering as teardown plugins, what about adding an attribute teardown
?
class MyTeardown(api.ContextPlugin):
teardown = True
And these kind of plugins will also guaranty to run even user pressed the GUI Stop button.
:point_up: This is something I might need for pyblish_qml
.
Goal
Enable preparation and handling of the initial and final stages of the publishing pipeline.
Motivation
At the moment, if processing fails in response to a failed test, there's little you can do. If system-wide state was changed during processing - such as files having been extracted, database written to - you aren't given a change to clean things up.
To balance this "teardown" process, we'll also have a "setup" that runs first, regardless of plug-in order. To setup database connections and other things relevant to the whole test, and later torn down in the tearndown plug-in.
Implemenation