diff options
| author | Thomi Richards <thomi.richards@canonical.com> | 2013-12-09 17:58:22 +1300 |
|---|---|---|
| committer | Thomi Richards <thomi.richards@canonical.com> | 2013-12-09 17:58:22 +1300 |
| commit | db6c2795d80729fcc6e197b7c533e91b6dcdcbcb (patch) | |
| tree | 37b2c2222db12c9eb8e4e2d4a4c2f0fe5d61514a /python | |
| parent | 9ba9d9588e66e97a5aade4b5f5b34ac3c2627cd8 (diff) | |
| download | subunit-git-db6c2795d80729fcc6e197b7c533e91b6dcdcbcb.tar.gz | |
Generate scenarios inside subunit.tests.test_suite, not by subclassing WithScenarios.
Diffstat (limited to 'python')
| -rw-r--r-- | python/subunit/tests/__init__.py | 6 | ||||
| -rw-r--r-- | python/subunit/tests/test_output_filter.py | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/python/subunit/tests/__init__.py b/python/subunit/tests/__init__.py index b5a7fdc..c1c2c64 100644 --- a/python/subunit/tests/__init__.py +++ b/python/subunit/tests/__init__.py @@ -17,6 +17,8 @@ import sys from unittest import TestLoader +from testscenarios import generate_scenarios + # Before the test module imports to avoid circularity. # For testing: different pythons have different str() implementations. @@ -61,5 +63,7 @@ def test_suite(): result.addTest(loader.loadTestsFromModule(test_subunit_tags)) result.addTest(loader.loadTestsFromModule(test_subunit_stats)) result.addTest(loader.loadTestsFromModule(test_run)) - result.addTest(loader.loadTestsFromModule(test_output_filter)) + result.addTests( + generate_scenarios(loader.loadTestsFromModule(test_output_filter)) + ) return result diff --git a/python/subunit/tests/test_output_filter.py b/python/subunit/tests/test_output_filter.py index f03a7b7..3373d48 100644 --- a/python/subunit/tests/test_output_filter.py +++ b/python/subunit/tests/test_output_filter.py @@ -22,7 +22,6 @@ import sys from tempfile import NamedTemporaryFile from contextlib import contextmanager -from testscenarios import WithScenarios from testtools import TestCase from testtools.compat import _u from testtools.matchers import ( @@ -58,7 +57,7 @@ class SafeOptionParser(optparse.OptionParser): safe_parse_arguments = partial(parse_arguments, ParserClass=SafeOptionParser) -class TestStatusArgParserTests(WithScenarios, TestCase): +class TestStatusArgParserTests(TestCase): scenarios = [ (cmd, dict(command=cmd, option='--' + cmd)) for cmd in _ALL_ACTIONS @@ -204,7 +203,7 @@ def temp_file_contents(data): yield f -class StatusStreamResultTests(WithScenarios, TestCase): +class StatusStreamResultTests(TestCase): scenarios = [ (s, dict(status=s, option='--' + s)) for s in _ALL_ACTIONS |
