diff options
author | Robert Collins <robertc@robertcollins.net> | 2015-05-04 12:12:16 +1200 |
---|---|---|
committer | Robert Collins <robertc@robertcollins.net> | 2015-05-04 12:12:16 +1200 |
commit | bccfaa71a2def5590161b6d1a247cf23c45a8b4d (patch) | |
tree | 4205080a391dc00332f018d781026b2381ddb2c6 /lib | |
parent | 475857af19a8190c9c0c7f8241b9907b942e19fd (diff) | |
download | testscenarios-bccfaa71a2def5590161b6d1a247cf23c45a8b4d.tar.gz |
0.4
~~~
IMPROVEMENTS
------------
* Python 3.2 support added. (Robert Collins)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/testscenarios/__init__.py | 2 | ||||
-rw-r--r-- | lib/testscenarios/scenarios.py | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/testscenarios/__init__.py b/lib/testscenarios/__init__.py index 356dc41..ceacf37 100644 --- a/lib/testscenarios/__init__.py +++ b/lib/testscenarios/__init__.py @@ -38,7 +38,7 @@ methods for details. # established at this point, and setup.py will use a version of next-$(revno). # If the releaselevel is 'final', then the tarball will be major.minor.micro. # Otherwise it is major.minor.micro~$(revno). -__version__ = (0, 3, 0, 'final', 0) +__version__ = (0, 4, 0, 'final', 0) __all__ = [ 'TestWithScenarios', diff --git a/lib/testscenarios/scenarios.py b/lib/testscenarios/scenarios.py index 9538b33..eeb72eb 100644 --- a/lib/testscenarios/scenarios.py +++ b/lib/testscenarios/scenarios.py @@ -34,7 +34,7 @@ from testtools.testcase import clone_test_with_new_id from testtools import iterate_tests -def apply_scenario((name, parameters), test): +def apply_scenario(scenario, test): """Apply scenario to test. :param scenario: A tuple (name, parameters) to apply to the test. The test @@ -43,6 +43,7 @@ def apply_scenario((name, parameters), test): :param test: The test to apply the scenario to. This test is unaltered. :return: A new test cloned from test, with the scenario applied. """ + name, parameters = scenario scenario_suffix = '(' + name + ')' newtest = clone_test_with_new_id(test, test.id() + scenario_suffix) @@ -50,7 +51,7 @@ def apply_scenario((name, parameters), test): if test_desc is not None: newtest_desc = "%(test_desc)s %(scenario_suffix)s" % vars() newtest.shortDescription = (lambda: newtest_desc) - for key, value in parameters.iteritems(): + for key, value in parameters.items(): setattr(newtest, key, value) return newtest |