Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_plugin_manager():
if not hasattr(MetaPluginManager._storage, 'plugin_manager'):
MetaPluginManager._storage.plugin_manager = PluginManager('allure')
MetaPluginManager._storage.plugin_manager.add_hookspecs(_hooks.AllureUserHooks)
MetaPluginManager._storage.plugin_manager.add_hookspecs(_hooks.AllureDeveloperHooks)
return MetaPluginManager._storage.plugin_manager
def get_plugin_manager():
if not hasattr(MetaPluginManager._storage, 'plugin_manager'):
MetaPluginManager._storage.plugin_manager = PluginManager('allure')
MetaPluginManager._storage.plugin_manager.add_hookspecs(_hooks.AllureUserHooks)
MetaPluginManager._storage.plugin_manager.add_hookspecs(_hooks.AllureDeveloperHooks)
return MetaPluginManager._storage.plugin_manager
class ExecutableItem(object):
name = attrib(default=None)
status = attrib(default=None)
statusDetails = attrib(default=None)
stage = attrib(default=None)
description = attrib(default=None)
descriptionHtml = attrib(default=None)
steps = attrib(default=Factory(list))
attachments = attrib(default=Factory(list))
parameters = attrib(default=Factory(list))
start = attrib(default=None)
stop = attrib(default=None)
@attrs
class TestResult(ExecutableItem):
file_pattern = TEST_CASE_PATTERN
uuid = attrib(default=None)
historyId = attrib(default=None)
testCaseId = attrib(default=None)
fullName = attrib(default=None)
labels = attrib(default=Factory(list))
links = attrib(default=Factory(list))
@attrs
class TestStepResult(ExecutableItem):
id = attrib(default=None)
@attrs
@attrs
class TestResult(ExecutableItem):
file_pattern = TEST_CASE_PATTERN
uuid = attrib(default=None)
historyId = attrib(default=None)
testCaseId = attrib(default=None)
fullName = attrib(default=None)
labels = attrib(default=Factory(list))
links = attrib(default=Factory(list))
@attrs
class TestStepResult(ExecutableItem):
id = attrib(default=None)
@attrs
class TestBeforeResult(ExecutableItem):
pass
@attrs
class TestAfterResult(ExecutableItem):
pass
@attrs
class Parameter(object):
name = attrib(default=None)
labels = attrib(default=Factory(list))
links = attrib(default=Factory(list))
@attrs
class TestStepResult(ExecutableItem):
id = attrib(default=None)
@attrs
class TestBeforeResult(ExecutableItem):
pass
@attrs
class TestAfterResult(ExecutableItem):
pass
@attrs
class Parameter(object):
name = attrib(default=None)
value = attrib(default=None)
@attrs
class Label(object):
name = attrib(default=None)
value = attrib(default=None)
@attrs
def start_step(self, parent_uuid=None, uuid=None):
parent = self._get_item(uuid=parent_uuid, item_type=ExecutableItem)
step = TestStepResult()
step.start = now()
parent.steps.append(step)
self._items[uuid or uuid4()] = step
yield step
uuid = attrib(default=None)
historyId = attrib(default=None)
testCaseId = attrib(default=None)
fullName = attrib(default=None)
labels = attrib(default=Factory(list))
links = attrib(default=Factory(list))
@attrs
class TestStepResult(ExecutableItem):
id = attrib(default=None)
@attrs
class TestBeforeResult(ExecutableItem):
pass
@attrs
class TestAfterResult(ExecutableItem):
pass
@attrs
class Parameter(object):
name = attrib(default=None)
value = attrib(default=None)
@attrs
class Label(object):
def impl(*a, **kw):
__tracebackhide__ = True
params = func_parameters(func, *a, **kw)
args = list(map(lambda x: represent(x), a))
with StepContext(self.title.format(*args, **params), params):
return func(*a, **kw)
return impl
def step(title):
if callable(title):
return StepContext(title.__name__, {})(title)
else:
return StepContext(title, {})
def step(title):
if callable(title):
return StepContext(title.__name__, {})(title)
else:
return StepContext(title, {})