summaryrefslogtreecommitdiffstats
path: root/ipatests/beakerlib_plugin.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2013-09-24 13:56:21 +0200
committerPetr Viktorin <pviktori@redhat.com>2013-10-03 19:50:35 +0200
commitf2e8624e767efcbf345a740b191f93a239685442 (patch)
tree2a66b429568e931afe019ea7eaad4430bdd9af68 /ipatests/beakerlib_plugin.py
parent0ad339a73134d08aebe9a6f72b001816bdcb9c1d (diff)
downloadfreeipa-f2e8624e767efcbf345a740b191f93a239685442.tar.gz
freeipa-f2e8624e767efcbf345a740b191f93a239685442.tar.xz
freeipa-f2e8624e767efcbf345a740b191f93a239685442.zip
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.
Diffstat (limited to 'ipatests/beakerlib_plugin.py')
-rw-r--r--ipatests/beakerlib_plugin.py9
1 files changed, 8 insertions, 1 deletions
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'):