Skip to content

Commit 3e1f5d0

Browse files
authored
Merge branch 'master' into ci-uv-install
2 parents d99af87 + 63017ae commit 3e1f5d0

File tree

62 files changed

+436
-447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+436
-447
lines changed

.flake8

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
run: uv pip install -r ./requirements/linting.txt
9090

9191
- name: Linting the codebase
92-
run: poe linter
92+
run: poe linter --output-format=github
9393

9494
test-pytest:
9595
name: Test allure-pytest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.tox
44
.pytest_cache
55
.python-version
6+
.ruff_cache
67
.venv
78

89
*.pyc

Jenkinsfile

Lines changed: 0 additions & 17 deletions
This file was deleted.

allure-behave/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.poe.tasks]
2-
linter = "flake8 --extend-ignore=A003 ./src"
2+
linter = "ruff check"
33

44
[tool.poe.tasks.tests]
55
cmd = "pytest ../tests/allure_behave"

allure-behave/setup.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
PACKAGE = "allure-behave"
55

66
classifiers = [
7-
'Development Status :: 5 - Production/Stable',
8-
'Intended Audience :: Developers',
9-
'License :: OSI Approved :: Apache Software License',
10-
'Topic :: Software Development :: Quality Assurance',
11-
'Topic :: Software Development :: Testing',
12-
'Topic :: Software Development :: Testing :: BDD',
13-
'Programming Language :: Python :: 3',
14-
'Programming Language :: Python :: 3 :: Only',
15-
'Programming Language :: Python :: 3.8',
16-
'Programming Language :: Python :: 3.9',
17-
'Programming Language :: Python :: 3.10',
18-
'Programming Language :: Python :: 3.11',
19-
'Programming Language :: Python :: 3.12',
20-
'Programming Language :: Python :: 3.13',
7+
"Development Status :: 5 - Production/Stable",
8+
"Intended Audience :: Developers",
9+
"License :: OSI Approved :: Apache Software License",
10+
"Topic :: Software Development :: Quality Assurance",
11+
"Topic :: Software Development :: Testing",
12+
"Topic :: Software Development :: Testing :: BDD",
13+
"Programming Language :: Python :: 3",
14+
"Programming Language :: Python :: 3 :: Only",
15+
"Programming Language :: Python :: 3.8",
16+
"Programming Language :: Python :: 3.9",
17+
"Programming Language :: Python :: 3.10",
18+
"Programming Language :: Python :: 3.11",
19+
"Programming Language :: Python :: 3.12",
20+
"Programming Language :: Python :: 3.13",
2121
]
2222

2323
setup_requires = [
@@ -64,5 +64,5 @@ def main():
6464
install_requires=install_requires
6565
)
6666

67-
if __name__ == '__main__':
67+
if __name__ == "__main__":
6868
main()

allure-behave/src/formatter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def _wrap_scenario(self, scenarios):
2424
if isinstance(scenario, ScenarioOutline):
2525
self._wrap_scenario(scenario)
2626
else:
27-
scenario.run = allure_commons.test(scenario.run, context={'scenario': scenario})
27+
scenario.run = allure_commons.test(scenario.run, context={"scenario": scenario})
2828
is_planned_scenario(scenario, self.testplan)
2929

3030
def uri(self, uri):

allure-behave/src/hooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(self, result_dir):
4545
self.listener = AllureListener(Configuration())
4646
self.plugins = []
4747

48-
if not hasattr(_storage, 'file_logger'):
48+
if not hasattr(_storage, "file_logger"):
4949
logger = AllureFileLogger(result_dir)
5050
_storage.file_logger = logger
5151
allure_commons.plugin_manager.register(logger)

allure-behave/src/listener.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
class AllureListener:
3030
def __init__(self, behave_config):
3131
self.behave_config = behave_config
32-
self.issue_pattern = behave_config.userdata.get('AllureFormatter.issue_pattern', None)
33-
self.link_pattern = behave_config.userdata.get('AllureFormatter.link_pattern', None)
34-
self.hide_excluded = behave_config.userdata.get('AllureFormatter.hide_excluded', False)
32+
self.issue_pattern = behave_config.userdata.get("AllureFormatter.issue_pattern", None)
33+
self.link_pattern = behave_config.userdata.get("AllureFormatter.link_pattern", None)
34+
self.hide_excluded = behave_config.userdata.get("AllureFormatter.hide_excluded", False)
3535
self.logger = AllureReporter()
3636
self.current_step_uuid = None
3737
self.current_scenario_uuid = None
@@ -70,7 +70,7 @@ def stop_feature(self):
7070

7171
@allure_commons.hookimpl
7272
def start_test(self, parent_uuid, uuid, name, parameters, context):
73-
self.start_scenario(context['scenario'])
73+
self.start_scenario(context["scenario"])
7474

7575
def start_scenario(self, scenario):
7676
self.current_scenario_uuid = uuid4()
@@ -82,7 +82,7 @@ def start_scenario(self, scenario):
8282
test_case.titlePath = get_title_path(scenario)
8383
test_case.historyId = scenario_history_id(scenario)
8484
test_case.testCaseId = md5(test_case.fullName)
85-
test_case.description = '\n'.join(scenario.description)
85+
test_case.description = "\n".join(scenario.description)
8686
test_case.parameters = scenario_parameters(scenario)
8787

8888
test_case.links.extend(scenario_links(
@@ -91,20 +91,20 @@ def start_scenario(self, scenario):
9191
link_pattern=self.link_pattern))
9292
test_case.labels.extend(scenario_labels(scenario))
9393
test_case.labels.append(Label(name=LabelType.FEATURE, value=scenario.feature.name))
94-
test_case.labels.append(Label(name=LabelType.FRAMEWORK, value='behave'))
94+
test_case.labels.append(Label(name=LabelType.FRAMEWORK, value="behave"))
9595
test_case.labels.append(Label(name=LabelType.LANGUAGE, value=platform_label()))
9696

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

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

103103
def stop_scenario(self, scenario):
104104
tag_expression = self.__get_tag_expression(self.behave_config)
105105
should_run = scenario.should_run_with_tags(tag_expression)
106106
should_run = should_run and scenario.should_run_with_name_select(self.behave_config)
107-
should_drop_skipped_by_option = scenario.status == 'skipped' and not self.behave_config.show_skipped
107+
should_drop_skipped_by_option = scenario.status == "skipped" and not self.behave_config.show_skipped
108108
should_drop_excluded = self.hide_excluded and (scenario.skip_reason == TEST_PLAN_SKIP_REASON or not should_run)
109109

110110
if should_drop_skipped_by_option or should_drop_excluded:
@@ -135,16 +135,16 @@ def match_step(self, match):
135135
def start_behave_step(self, step):
136136

137137
self.current_step_uuid = uuid4()
138-
name = f'{step.keyword} {step.name}'
138+
name = f"{step.keyword} {step.name}"
139139

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

143143
if step.text:
144-
self.logger.attach_data(uuid4(), step.text, name='.text', attachment_type=AttachmentType.TEXT)
144+
self.logger.attach_data(uuid4(), step.text, name=".text", attachment_type=AttachmentType.TEXT)
145145

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

149149
def stop_behave_step(self, result):
150150
status = step_status(result)
@@ -194,7 +194,7 @@ def add_description_html(self, test_description_html):
194194
def add_link(self, url, link_type, name):
195195
test_result = self.logger.get_test(None)
196196
if test_result:
197-
pattern = '{}'
197+
pattern = "{}"
198198
if link_type == LinkType.ISSUE and self.issue_pattern:
199199
pattern = self.issue_pattern
200200
elif link_type == LinkType.LINK and self.link_pattern:
@@ -230,7 +230,7 @@ def enter(self):
230230
self._logger.start_group(group.uuid, group)
231231
self._groups.append(group)
232232

233-
def exit(self): # noqa: A003
233+
def exit(self):
234234
group = self._groups.pop()
235235
if group.befores or group.afters:
236236
self._logger.stop_group(group.uuid)

allure-behave/src/utils.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
TEST_PLAN_SKIP_REASON = "Not in allure test plan"
1515

1616
STATUS = {
17-
'passed': Status.PASSED,
18-
'failed': Status.FAILED,
19-
'skipped': Status.SKIPPED,
20-
'untested': Status.SKIPPED,
21-
'undefined': Status.BROKEN
17+
"passed": Status.PASSED,
18+
"failed": Status.FAILED,
19+
"skipped": Status.SKIPPED,
20+
"untested": Status.SKIPPED,
21+
"undefined": Status.BROKEN
2222
}
2323

2424

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

3636

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

5858
def scenario_status(scenario):
5959
for step in scenario.all_steps:
60-
if step_status(step) != 'passed':
60+
if step_status(step) != "passed":
6161
return step_status(step)
6262
return Status.PASSED
6363

6464

6565
def scenario_status_details(scenario):
6666
for step in scenario.all_steps:
67-
if step_status(step) != 'passed':
67+
if step_status(step) != "passed":
6868
return step_status_details(step)
6969

7070

@@ -151,8 +151,8 @@ def step_status_details(result):
151151
trace=trace
152152
)
153153

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

0 commit comments

Comments
 (0)