summaryrefslogtreecommitdiff
path: root/cmdtestlib.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-01-20 18:19:21 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-01-20 18:19:21 +0000
commit1a62be25fbffd09d1cf1797c4a65e376f37a2156 (patch)
treeb663986d1afc2a0029a3de3752d1fcd1ae478288 /cmdtestlib.py
parent1bec9bee0c3105430a51ced2771e130066019c95 (diff)
downloadcmdtest-1a62be25fbffd09d1cf1797c4a65e376f37a2156.tar.gz
Fix cmdtest -t foo so that it still runs the setup/setup_once/teardown/teardown_once scripts
Diffstat (limited to 'cmdtestlib.py')
-rw-r--r--cmdtestlib.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmdtestlib.py b/cmdtestlib.py
index a42b459..a064cbc 100644
--- a/cmdtestlib.py
+++ b/cmdtestlib.py
@@ -46,8 +46,9 @@ class TestDir(object):
script_names = ['setup_once', 'setup', 'teardown', 'teardown_once']
for name in script_names:
- if name in filenames:
- setattr(self, name, os.path.join(dirname, name))
+ full_path = os.path.join(dirname, name)
+ if os.path.exists(full_path):
+ setattr(self, name, full_path)
prefixes = self.find_prefixes(filenames)
for prefix in prefixes: