[docs] Fix plugin references for class-based scenarios
InfoMixin obtains documentation from objects __doc__ properties. In case of class based scenarios, __doc__ property is empty ( we decided to use docstrings of "run" method). This patch adds new object property - _doc_source_, which should include object from which docstings will be used. Change-Id: I799222fe213b96a88110d6d2ebb5aa3fe2d8f153
This commit is contained in:
parent
f5f9646ba1
commit
2f99a0982b
@ -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(),
|
||||
|
@ -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("."):
|
||||
|
Loading…
Reference in New Issue
Block a user