diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2011-12-01 10:40:44 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2011-12-01 10:40:44 +0000 |
commit | 3d334e94be2dc713a640047380ab1437377c8331 (patch) | |
tree | 80a33cd0ecc0dc2033832ced28466bc28b0067ec | |
parent | b85a38056aa5b6ca256a579c3c7616491e629df4 (diff) | |
download | cmdtest-3d334e94be2dc713a640047380ab1437377c8331.tar.gz |
create and clean temporary directory only once per run
This way, the temporary directory can be used by setup_once and
teardown_once, and they can share files.
-rwxr-xr-x | cmdtest | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -61,10 +61,10 @@ class CommandTester(cliapp.Application): self.ts['tests'] = td.tests errors = 0 + self.setup_tempdir() self.run_script(td.setup_once) for test in td.tests: self.ts['test'] = test - self.setup_tempdir() self.run_script(td.setup) for e in self.run_test(test): logging.error(str(e)) @@ -72,8 +72,8 @@ class CommandTester(cliapp.Application): self.output.write('%s\n' % str(e)) errors += 1 self.run_script(td.teardown) - self.cleanup_tempdir() self.run_script(td.teardown_once) + self.cleanup_tempdir() ok = len(td.tests) - errors self.ts.finish() |