def pytest_runtest_setup(item): severity = severity_of(item) item_labels = labels_of(item) option = item.config.option if option.allureseverities and severity not in \ option.allureseverities: pytest.skip("Not running test of severity %s." % severity) arg_labels = option.allurefeatures + option.allurestories if arg_labels and not item_labels & arg_labels: pytest.skip('Not suitable with selected labels: %s.' % arg_labels)
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), 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, __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 pytest_runtest_setup(item): severity = severity_of(item) if item.config.getoption('--allure_severities') and severity not in item.config.getoption('--allure_severities'): pytest.skip("Not running test of severity %s" % severity)