On Fri, Nov 1, 2013 at 2:26 PM, Ryan Ollos <[email protected]> wrote:
> On Fri, Nov 1, 2013 at 11:23 AM, Olemis Lang <[email protected]> wrote: > > > On Thu, Oct 31, 2013 at 12:53 PM, Ryan Ollos <[email protected] > > >wrote: > > [...] > > > The reason I care about this is that I'm working on adding a > > > cleanup method (via TestCase.addCleanup) to > > > bloodhound_multiproduct.tests.env:MultiproductTestCase._setup_test_env > > that > > > removes the temporary environment directories after the test run > > completes. > > > env.path is needed, and if env is set to None in the tearDown method, > > then > > > the cleanup function will throw an exception. > > > > > > > I've recently seen a changeset about that ... [r1537391] ? ... well, if > you > > want to add such a function then ensure that memory for those (useless) > > objects is also released afterwards . Does it makes any sense , or is > there > > any other major objection ? > > > > Thank you for the explanation. I will try moving "release of objects" from > the tearDown methods into the proposed _teardown_test_env "cleanup" > function. I think it will look something like this, > > def _teardown_test_env(self): > if env.path: > shutil.rmtree(env.path) > self.env = None > if self.prod_env: > self.global_env = None > If it works and tearDown is not wnough ... afaict I'm ok with it ... -- Regards, Olemis - @olemislc
