Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .flake8

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
run: pip install -r ./requirements/linting.txt

- name: Linting the codebase
run: poe linter
run: poe linter --output-format=github

test-pytest:
name: Test allure-pytest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.tox
.pytest_cache
.python-version
.ruff_cache
.venv

*.pyc
Expand Down
17 changes: 0 additions & 17 deletions Jenkinsfile

This file was deleted.

2 changes: 1 addition & 1 deletion allure-behave/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poe.tasks]
linter = "flake8 --extend-ignore=A003 ./src"
linter = "ruff check"

[tool.poe.tasks.tests]
cmd = "pytest ../tests/allure_behave"
Expand Down
30 changes: 15 additions & 15 deletions allure-behave/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
PACKAGE = "allure-behave"

classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Topic :: Software Development :: Quality Assurance',
'Topic :: Software Development :: Testing',
'Topic :: Software Development :: Testing :: BDD',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
"Topic :: Software Development :: Testing :: BDD",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]

setup_requires = [
Expand Down Expand Up @@ -64,5 +64,5 @@ def main():
install_requires=install_requires
)

if __name__ == '__main__':
if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion allure-behave/src/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def _wrap_scenario(self, scenarios):
if isinstance(scenario, ScenarioOutline):
self._wrap_scenario(scenario)
else:
scenario.run = allure_commons.test(scenario.run, context={'scenario': scenario})
scenario.run = allure_commons.test(scenario.run, context={"scenario": scenario})
is_planned_scenario(scenario, self.testplan)

def uri(self, uri):
Expand Down
2 changes: 1 addition & 1 deletion allure-behave/src/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self, result_dir):
self.listener = AllureListener(Configuration())
self.plugins = []

if not hasattr(_storage, 'file_logger'):
if not hasattr(_storage, "file_logger"):
logger = AllureFileLogger(result_dir)
_storage.file_logger = logger
allure_commons.plugin_manager.register(logger)
Expand Down
26 changes: 13 additions & 13 deletions allure-behave/src/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
class AllureListener:
def __init__(self, behave_config):
self.behave_config = behave_config
self.issue_pattern = behave_config.userdata.get('AllureFormatter.issue_pattern', None)
self.link_pattern = behave_config.userdata.get('AllureFormatter.link_pattern', None)
self.hide_excluded = behave_config.userdata.get('AllureFormatter.hide_excluded', False)
self.issue_pattern = behave_config.userdata.get("AllureFormatter.issue_pattern", None)
self.link_pattern = behave_config.userdata.get("AllureFormatter.link_pattern", None)
self.hide_excluded = behave_config.userdata.get("AllureFormatter.hide_excluded", False)
self.logger = AllureReporter()
self.current_step_uuid = None
self.current_scenario_uuid = None
Expand Down Expand Up @@ -70,7 +70,7 @@ def stop_feature(self):

@allure_commons.hookimpl
def start_test(self, parent_uuid, uuid, name, parameters, context):
self.start_scenario(context['scenario'])
self.start_scenario(context["scenario"])

def start_scenario(self, scenario):
self.current_scenario_uuid = uuid4()
Expand All @@ -82,7 +82,7 @@ def start_scenario(self, scenario):
test_case.titlePath = get_title_path(scenario)
test_case.historyId = scenario_history_id(scenario)
test_case.testCaseId = md5(test_case.fullName)
test_case.description = '\n'.join(scenario.description)
test_case.description = "\n".join(scenario.description)
test_case.parameters = scenario_parameters(scenario)

test_case.links.extend(scenario_links(
Expand All @@ -91,20 +91,20 @@ def start_scenario(self, scenario):
link_pattern=self.link_pattern))
test_case.labels.extend(scenario_labels(scenario))
test_case.labels.append(Label(name=LabelType.FEATURE, value=scenario.feature.name))
test_case.labels.append(Label(name=LabelType.FRAMEWORK, value='behave'))
test_case.labels.append(Label(name=LabelType.FRAMEWORK, value="behave"))
test_case.labels.append(Label(name=LabelType.LANGUAGE, value=platform_label()))

self.logger.schedule_test(self.current_scenario_uuid, test_case)

@allure_commons.hookimpl
def stop_test(self, parent_uuid, uuid, name, context, exc_type, exc_val, exc_tb):
self.stop_scenario(context['scenario'])
self.stop_scenario(context["scenario"])

def stop_scenario(self, scenario):
tag_expression = self.__get_tag_expression(self.behave_config)
should_run = scenario.should_run_with_tags(tag_expression)
should_run = should_run and scenario.should_run_with_name_select(self.behave_config)
should_drop_skipped_by_option = scenario.status == 'skipped' and not self.behave_config.show_skipped
should_drop_skipped_by_option = scenario.status == "skipped" and not self.behave_config.show_skipped
should_drop_excluded = self.hide_excluded and (scenario.skip_reason == TEST_PLAN_SKIP_REASON or not should_run)

if should_drop_skipped_by_option or should_drop_excluded:
Expand Down Expand Up @@ -135,16 +135,16 @@ def match_step(self, match):
def start_behave_step(self, step):

self.current_step_uuid = uuid4()
name = f'{step.keyword} {step.name}'
name = f"{step.keyword} {step.name}"

allure_step = TestStepResult(name=name, start=now())
self.logger.start_step(None, self.current_step_uuid, allure_step)

if step.text:
self.logger.attach_data(uuid4(), step.text, name='.text', attachment_type=AttachmentType.TEXT)
self.logger.attach_data(uuid4(), step.text, name=".text", attachment_type=AttachmentType.TEXT)

if step.table:
self.logger.attach_data(uuid4(), step_table(step), name='.table', attachment_type=AttachmentType.CSV)
self.logger.attach_data(uuid4(), step_table(step), name=".table", attachment_type=AttachmentType.CSV)

def stop_behave_step(self, result):
status = step_status(result)
Expand Down Expand Up @@ -194,7 +194,7 @@ def add_description_html(self, test_description_html):
def add_link(self, url, link_type, name):
test_result = self.logger.get_test(None)
if test_result:
pattern = '{}'
pattern = "{}"
if link_type == LinkType.ISSUE and self.issue_pattern:
pattern = self.issue_pattern
elif link_type == LinkType.LINK and self.link_pattern:
Expand Down Expand Up @@ -230,7 +230,7 @@ def enter(self):
self._logger.start_group(group.uuid, group)
self._groups.append(group)

def exit(self): # noqa: A003
def exit(self):
group = self._groups.pop()
if group.befores or group.afters:
self._logger.stop_group(group.uuid)
Expand Down
20 changes: 10 additions & 10 deletions allure-behave/src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
TEST_PLAN_SKIP_REASON = "Not in allure test plan"

STATUS = {
'passed': Status.PASSED,
'failed': Status.FAILED,
'skipped': Status.SKIPPED,
'untested': Status.SKIPPED,
'undefined': Status.BROKEN
"passed": Status.PASSED,
"failed": Status.FAILED,
"skipped": Status.SKIPPED,
"untested": Status.SKIPPED,
"undefined": Status.BROKEN
}


Expand All @@ -30,7 +30,7 @@ def scenario_history_id(scenario):
parts = [scenario.feature.name, scenario.name]
if scenario._row:
row = scenario._row
parts.extend([f'{name}={value}' for name, value in zip(row.headings, row.cells)])
parts.extend([f"{name}={value}" for name, value in zip(row.headings, row.cells)])
return md5(*parts)


Expand All @@ -57,14 +57,14 @@ def scenario_labels(scenario):

def scenario_status(scenario):
for step in scenario.all_steps:
if step_status(step) != 'passed':
if step_status(step) != "passed":
return step_status(step)
return Status.PASSED


def scenario_status_details(scenario):
for step in scenario.all_steps:
if step_status(step) != 'passed':
if step_status(step) != "passed":
return step_status_details(step)


Expand Down Expand Up @@ -151,8 +151,8 @@ def step_status_details(result):
trace=trace
)

elif result.status == 'undefined':
message = '\nYou can implement step definitions for undefined steps with these snippets:\n\n'
elif result.status == "undefined":
message = "\nYou can implement step definitions for undefined steps with these snippets:\n\n"
message += make_undefined_step_snippet(result)
return StatusDetails(message=message)

Expand Down
2 changes: 1 addition & 1 deletion allure-nose2/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poe.tasks]
linter = "flake8 ./src"
linter = "ruff check"

[tool.poe.tasks.tests]
cmd = "pytest ../tests/allure_nose2"
Expand Down
28 changes: 14 additions & 14 deletions allure-nose2/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
PACKAGE = "allure-nose2"

classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Topic :: Software Development :: Quality Assurance',
'Topic :: Software Development :: Testing',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]

setup_requires = [
Expand Down Expand Up @@ -63,5 +63,5 @@ def main():
)


if __name__ == '__main__':
if __name__ == "__main__":
main()
4 changes: 2 additions & 2 deletions allure-nose2/src/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def unregister(cls):


class Allure(Plugin):
configSection = 'allure'
configSection = "allure"
commandLineSwitch = (None, "allure", "Generate an Allure report")

def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -95,7 +95,7 @@ def startTest(self, event):
test_result.labels.extend(labels(event.test))
test_result.labels.append(Label(name=LabelType.HOST, value=self._host))
test_result.labels.append(Label(name=LabelType.THREAD, value=self._thread))
test_result.labels.append(Label(name=LabelType.FRAMEWORK, value='nose2'))
test_result.labels.append(Label(name=LabelType.FRAMEWORK, value="nose2"))
test_result.labels.append(Label(name=LabelType.LANGUAGE, value=platform_label()))
test_result.parameters = params(event)

Expand Down
10 changes: 5 additions & 5 deletions allure-nose2/src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

# ToDo move to commons
ALLURE_LABELS = [
'epic',
'feature',
'story',
"epic",
"feature",
"story",
]


Expand All @@ -21,8 +21,8 @@ def status_details(event):
message, trace = None, None
if event.exc_info:
exc_type, value, _ = event.exc_info
message = '\n'.join(format_exception_only(exc_type, value)) if exc_type or value else None
trace = ''.join(util.exc_info_to_string(event.exc_info, event.test))
message = "\n".join(format_exception_only(exc_type, value)) if exc_type or value else None
trace = "".join(util.exc_info_to_string(event.exc_info, event.test))
elif event.reason:
message = event.reason

Expand Down
2 changes: 1 addition & 1 deletion allure-pytest-bdd/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poe.tasks]
linter = "flake8 ./src"
linter = "ruff check"

[tool.poe.tasks.tests]
cmd = "pytest ../tests/allure_pytest_bdd"
Expand Down
32 changes: 16 additions & 16 deletions allure-pytest-bdd/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
PACKAGE = "allure-pytest-bdd"

classifiers = [
'Development Status :: 5 - Production/Stable',
'Framework :: Pytest',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Topic :: Software Development :: Quality Assurance',
'Topic :: Software Development :: Testing',
'Topic :: Software Development :: Testing :: BDD',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
"Development Status :: 5 - Production/Stable",
"Framework :: Pytest",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
"Topic :: Software Development :: Testing :: BDD",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]

setup_requires = [
Expand Down Expand Up @@ -67,5 +67,5 @@ def main():
)


if __name__ == '__main__':
if __name__ == "__main__":
main()
Loading