diff --git a/rally/common/plugin/info.py b/rally/common/plugin/info.py index 003ff00f7e..b410f93008 100644 --- a/rally/common/plugin/info.py +++ b/rally/common/plugin/info.py @@ -83,7 +83,8 @@ class InfoMixin(object): @classmethod def get_info(cls): plugin_ = getattr(cls, "func_ref", cls) - doc = parse_docstring(plugin_.__doc__) + doc_source = getattr(plugin_, "_doc_source_", plugin_) + doc = parse_docstring(doc_source.__doc__) return { "name": plugin_.get_name(), diff --git a/rally/task/scenario.py b/rally/task/scenario.py index 9aae346730..a4e0e7579f 100644 --- a/rally/task/scenario.py +++ b/rally/task/scenario.py @@ -50,6 +50,9 @@ def configure(name=None, namespace="default", context=None): scen.is_classbased = hasattr(scen, "run") and callable(scen.run) if not scen.is_classbased: plugin.from_func(Scenario)(scen) + else: + scen._doc_source_ = scen.run + scen._meta_init() if name: if "." not in name.strip("."):