summaryrefslogtreecommitdiff
path: root/lib/testscenarios/testcase.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/testscenarios/testcase.py')
-rw-r--r--lib/testscenarios/testcase.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/testscenarios/testcase.py b/lib/testscenarios/testcase.py
index 23907fb..0c34c71 100644
--- a/lib/testscenarios/testcase.py
+++ b/lib/testscenarios/testcase.py
@@ -37,15 +37,26 @@ class TestWithScenarios(unittest.TestCase):
subclass (or overridden compatibly with TestWithScenarios).
"""
+ def _get_scenarios(self):
+ return getattr(self, 'scenarios', None)
+
def countTestCases(self):
- scenarios = getattr(self, 'scenarios', None)
+ scenarios = self._get_scenarios()
if not scenarios:
return 1
else:
return len(scenarios)
+ def debug(self):
+ scenarios = self._get_scenarios()
+ if scenarios:
+ for test in generate_scenarios(self):
+ test.debug()
+ else:
+ return super(TestWithScenarios, self).debug()
+
def run(self, result=None):
- scenarios = getattr(self, 'scenarios', None)
+ scenarios = self._get_scenarios()
if scenarios:
for test in generate_scenarios(self):
test.run(result)