Chris Spencer
2017-03-10 16:36:31 UTC
I'm trying to write unittests to check some Fabric-based functionality, and
I'm running into some roadblocks with the @runs_once decorator. Some tests
are failing when other tests call tasks decorated by @runs_once, since the
decorator caches the very first return value.
From inspecting the code, I see I can simply clear this by doing `del
mytask.return_value`. However, to properly fix this in all tests, I'll have
to track down every task that uses @runs_once and delete this, which will
be tedious.
Is there an easier to to reset @runs_once globally?
I'm running into some roadblocks with the @runs_once decorator. Some tests
are failing when other tests call tasks decorated by @runs_once, since the
decorator caches the very first return value.
From inspecting the code, I see I can simply clear this by doing `del
mytask.return_value`. However, to properly fix this in all tests, I'll have
to track down every task that uses @runs_once and delete this, which will
be tedious.
Is there an easier to to reset @runs_once globally?