def pytest_runtest_protocol(self, item, nextitem): if not self.testsuite: module = parent_module(item) self.impl.start_suite(name=module.module.__name__, description=module.module.__doc__ or None) self.testsuite = 'Yes' name = '.'.join(mangle_testnames([x.name for x in parent_down_from_module(item)])) self.impl.start_case(name, description=item.function.__doc__, labels=labels_of(item)) yield if not nextitem or parent_module(item) != parent_module(nextitem): self.impl.stop_suite() self.testsuite = None
def pytest_runtest_protocol(self, __multicall__, item, nextitem): if not self.testsuite: module = parent_module(item) self.impl.start_suite(name='.'.join(mangle_testnames(module.nodeid.split("::"))), description=module.module.__doc__ or None) self.testsuite = 'Yes' name = '.'.join(mangle_testnames([x.name for x in parent_down_from_module(item)])) self.impl.start_case(name, description=item.function.__doc__, labels=labels_of(item)) result = __multicall__.execute() if not nextitem or parent_module(item) != parent_module(nextitem): self.impl.stop_suite() self.testsuite = None return result
def pytest_runtest_protocol(self, item, nextitem): if not self.testsuite: module = parent_module(item) self.impl.start_suite(name=module.module.__name__, description=module.module.__doc__ or None) self.testsuite = 'Yes' name = '.'.join( mangle_testnames([x.name for x in parent_down_from_module(item)])) self.impl.start_case(name, description=item.function.__doc__, labels=labels_of(item)) yield if not nextitem or parent_module(item) != parent_module(nextitem): self.impl.stop_suite() self.testsuite = None
def report_case(self, item, report): """ Adds `self.test` to the `report` in a `AllureAggegatingListener`-understood way """ parent = parent_module(item) # we attach a four-tuple: (test module ID, test module name, test module doc, environment, TestCase) report.__dict__.update( _allure_result=pickle.dumps((parent.nodeid, parent.module.__name__, parent.module.__doc__ or '', self.environment, self.test)))
def pytest_runtest_protocol(self, __multicall__, item, nextitem): if not self.testsuite: module = parent_module(item) self.impl.start_suite(name='.'.join(mangle_testnames(module.nodeid.split("::"))), description=module.module.__doc__ or None) self.testsuite = 'Yes' name = '.'.join(mangle_testnames([x.name for x in parent_down_from_module(item)])) self.impl.start_case(name, description=item.function.__doc__, severity=severity_of(item)) result = __multicall__.execute() if not nextitem or parent_module(item) != parent_module(nextitem): self.impl.stop_suite() self.testsuite = None return result
def report_case(self, item, report): """ Adds `self.test` to the `report` in a `AllureAggegatingListener`-understood way """ parent = parent_module(item) # we attach a four-tuple: (test module ID, test module name, test module doc, environment, TestCase) report.__dict__.update( _allure_result=pickle.dumps( (parent.nodeid, parent.module.__name__, parent.module.__doc__ or "", self.environment, self.test) ) )