summaryrefslogtreecommitdiff
path: root/cmdtest
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-12-01 10:40:44 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-12-01 10:40:44 +0000
commit3d334e94be2dc713a640047380ab1437377c8331 (patch)
tree80a33cd0ecc0dc2033832ced28466bc28b0067ec /cmdtest
parentb85a38056aa5b6ca256a579c3c7616491e629df4 (diff)
downloadcmdtest-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.
Diffstat (limited to 'cmdtest')
-rwxr-xr-xcmdtest4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmdtest b/cmdtest
index 62ea3b0..e84602b 100755
--- a/cmdtest
+++ b/cmdtest
@@ -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()