Skip to content

Commit d108e55

Browse files
committed
refactor: fix lint issues
1 parent 3c9f60a commit d108e55

6 files changed

Lines changed: 57 additions & 13 deletions

File tree

allure-pytest/src/listener.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,23 @@ def attach_file(self, source, name, attachment_type, extension):
259259

260260
@allure_commons.hookimpl
261261
def global_attach_data(self, body, name, attachment_type, extension):
262-
self.allure_logger.global_attach_data(uuid4(), body, name=name, attachment_type=attachment_type, extension=extension)
262+
self.allure_logger.global_attach_data(
263+
uuid4(),
264+
body,
265+
name=name,
266+
attachment_type=attachment_type,
267+
extension=extension,
268+
)
263269

264270
@allure_commons.hookimpl
265271
def global_attach_file(self, source, name, attachment_type, extension):
266-
self.allure_logger.global_attach_file(uuid4(), source, name=name, attachment_type=attachment_type, extension=extension)
272+
self.allure_logger.global_attach_file(
273+
uuid4(),
274+
source,
275+
name=name,
276+
attachment_type=attachment_type,
277+
extension=extension,
278+
)
267279

268280
@allure_commons.hookimpl
269281
def global_error(self, message, trace):

allure-python-commons/src/allure_commons/_allure.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,20 @@ def file(self, source, name=None, attachment_type=None, extension=None):
220220
class GlobalAttach:
221221

222222
def __call__(self, body, name=None, attachment_type=None, extension=None):
223-
plugin_manager.hook.global_attach_data(body=body, name=name, attachment_type=attachment_type, extension=extension)
223+
plugin_manager.hook.global_attach_data(
224+
body=body,
225+
name=name,
226+
attachment_type=attachment_type,
227+
extension=extension,
228+
)
224229

225230
def file(self, source, name=None, attachment_type=None, extension=None):
226-
plugin_manager.hook.global_attach_file(source=source, name=name, attachment_type=attachment_type, extension=extension)
231+
plugin_manager.hook.global_attach_file(
232+
source=source,
233+
name=name,
234+
attachment_type=attachment_type,
235+
extension=extension,
236+
)
227237

228238

229239
global_attach = GlobalAttach()

allure-python-commons/src/allure_commons/lifecycle.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ def stop_after_fixture(self, uuid=None):
125125
fixture.stop = now()
126126

127127
def _attach(self, uuid, name=None, attachment_type=None, extension=None, parent_uuid=None):
128-
file_name, mime_type = self.__resolve_attachment_filename_and_type(uuid, attachment_type=attachment_type, extension=extension)
128+
file_name, mime_type = self.__resolve_attachment_filename_and_type(
129+
uuid,
130+
attachment_type=attachment_type,
131+
extension=extension,
132+
)
129133
attachment = Attachment(source=file_name, name=name, type=mime_type)
130134
last_uuid = parent_uuid if parent_uuid else self._last_item_uuid(ExecutableItem)
131135
self._items[last_uuid].attachments.append(attachment)
@@ -143,14 +147,22 @@ def attach_data(self, uuid, body, name=None, attachment_type=None, extension=Non
143147
plugin_manager.hook.report_attached_data(body=body, file_name=file_name)
144148

145149
def global_attach_file(self, uuid, source, name=None, attachment_type=None, extension=None):
146-
file_name, mime_type = self.__resolve_attachment_filename_and_type(uuid, attachment_type=attachment_type, extension=extension)
150+
file_name, mime_type = self.__resolve_attachment_filename_and_type(
151+
uuid,
152+
attachment_type=attachment_type,
153+
extension=extension,
154+
)
147155
plugin_manager.hook.report_attached_file(source=source, file_name=file_name)
148156
plugin_manager.hook.report_globals(globals_item=Globals(attachments=[
149157
GlobalAttachment(source=file_name, name=name, type=mime_type, timestamp=now())
150158
]))
151159

152160
def global_attach_data(self, uuid, body, name=None, attachment_type=None, extension=None):
153-
file_name, mime_type = self.__resolve_attachment_filename_and_type(uuid, attachment_type=attachment_type, extension=extension)
161+
file_name, mime_type = self.__resolve_attachment_filename_and_type(
162+
uuid,
163+
attachment_type=attachment_type,
164+
extension=extension,
165+
)
154166
plugin_manager.hook.report_attached_data(body=body, file_name=file_name)
155167
plugin_manager.hook.report_globals(globals_item=Globals(attachments=[
156168
GlobalAttachment(source=file_name, name=name, type=mime_type, timestamp=now())

allure-python-commons/src/allure_commons/reporter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,14 @@ def attach_data(self, uuid, body, name=None, attachment_type=None, extension=Non
159159
plugin_manager.hook.report_attached_data(body=body, file_name=file_name)
160160

161161
def global_attach_file(self, uuid, source, name=None, attachment_type=None, extension=None):
162-
file_name, mime_type = self.__resolve_attachment_filename_and_type(uuid, attachment_type=attachment_type, extension=extension)
162+
file_name, mime_type = self.__resolve_attachment_filename_and_type(uuid, attachment_type, extension)
163163
plugin_manager.hook.report_attached_file(source=source, file_name=file_name)
164164
plugin_manager.hook.report_globals(globals_item=Globals(attachments=[
165165
GlobalAttachment(source=file_name, name=name, type=mime_type, timestamp=now())
166166
]))
167167

168168
def global_attach_data(self, uuid, body, name=None, attachment_type=None, extension=None):
169-
file_name, mime_type = self.__resolve_attachment_filename_and_type(uuid, attachment_type=attachment_type, extension=extension)
169+
file_name, mime_type = self.__resolve_attachment_filename_and_type(uuid, attachment_type, extension)
170170
plugin_manager.hook.report_attached_data(body=body, file_name=file_name)
171171
plugin_manager.hook.report_globals(globals_item=Globals(attachments=[
172172
GlobalAttachment(source=file_name, name=name, type=mime_type, timestamp=now())

allure-robotframework/src/listener/allure_listener.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,23 @@ def attach_file(self, source, name, attachment_type, extension):
241241

242242
@allure_commons.hookimpl
243243
def global_attach_data(self, body, name, attachment_type, extension):
244-
self.lifecycle.global_attach_data(uuid4(), body, name=name, attachment_type=attachment_type, extension=extension)
244+
self.lifecycle.global_attach_data(
245+
uuid4(),
246+
body,
247+
name=name,
248+
attachment_type=attachment_type,
249+
extension=extension,
250+
)
245251

246252
@allure_commons.hookimpl
247253
def global_attach_file(self, source, name, attachment_type, extension):
248-
self.lifecycle.global_attach_file(uuid4(), source, name=name, attachment_type=attachment_type, extension=extension)
254+
self.lifecycle.global_attach_file(
255+
uuid4(),
256+
source,
257+
name=name,
258+
attachment_type=attachment_type,
259+
extension=extension,
260+
)
249261

250262
@allure_commons.hookimpl
251263
def global_error(self, message, trace):

tests/allure_pytest_bdd/acceptance/globals_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
from allure_commons_test.result import with_message_contains
99

1010
from tests.allure_pytest.pytest_runner import AllurePytestRunner
11-
from tests.e2e import version_lt
12-
from tests.e2e import version_gte
1311

1412

1513
def test_global_attachment_and_error_from_hook(allure_pytest_bdd_runner: AllurePytestRunner):

0 commit comments

Comments
 (0)