From f2e8624e767efcbf345a740b191f93a239685442 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 24 Sep 2013 13:56:21 +0200 Subject: ipatests.beakerlib_plugin: Add argument of generated tests to test captions To differentiate between individual tests in BeakerLib output, the argument needs to be added to the test name. Since Nose doesn't provide a way to get the argument in a plugin, a `test_argument` attribute must be added to the test function to support this, simlarly to how `description` is used to set individual "docstrings". Add test_argument to the generated tests in the CA-less suite. --- ipatests/beakerlib_plugin.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ipatests/beakerlib_plugin.py') diff --git a/ipatests/beakerlib_plugin.py b/ipatests/beakerlib_plugin.py index 2635e4b80..45f34c6a6 100644 --- a/ipatests/beakerlib_plugin.py +++ b/ipatests/beakerlib_plugin.py @@ -233,7 +233,14 @@ class BeakerLibPlugin(Plugin): caption = test.shortDescription() if not caption: caption = 'Nose method (no docstring)' - phase_name = "%s: %s" % (test.id().replace('.', '-'), caption) + phase_name = test.id().replace('.', '-') + method = test + while hasattr(method, 'test'): + method = method.test + argument = getattr(method, 'test_argument', None) + if argument: + phase_name += '-%s' % re.sub('[^-a-zA-Z0-9]+', '_', str(argument)) + phase_name += ": %s" % caption self.run_beakerlib_command(['rlPhaseStart', 'FAIL', phase_name]) while hasattr(test, 'test'): -- cgit