|
1 | 1 | """This module includes Service functions for work with pytest agent.""" |
2 | 2 |
|
3 | 3 | import logging |
4 | | -from os import getenv |
5 | 4 | import sys |
6 | 5 | import traceback |
| 6 | +from os import getenv |
7 | 7 | from time import time |
8 | 8 |
|
9 | 9 | import pkg_resources |
10 | 10 | import pytest |
11 | 11 | from _pytest.doctest import DoctestItem |
12 | 12 | from _pytest.main import Session |
13 | 13 | from _pytest.nodes import File, Item |
14 | | -from _pytest.warning_types import PytestWarning |
15 | 14 | from _pytest.python import Class, Function, Instance, Module |
16 | 15 | from _pytest.unittest import TestCaseFunction, UnitTestCase |
17 | | - |
| 16 | +from _pytest.warning_types import PytestWarning |
18 | 17 | from reportportal_client import ReportPortalService |
19 | 18 | from reportportal_client.external.google_analytics import send_event |
20 | 19 | from reportportal_client.helpers import ( |
|
26 | 25 | from six import with_metaclass |
27 | 26 | from six.moves import queue |
28 | 27 |
|
29 | | - |
30 | 28 | log = logging.getLogger(__name__) |
31 | 29 |
|
32 | 30 |
|
@@ -137,11 +135,11 @@ def init_service(self, |
137 | 135 | self._errors = queue.Queue() |
138 | 136 | if self.rp is None: |
139 | 137 | self.ignore_errors = ignore_errors |
140 | | - self.ignored_attributes = ignored_attributes |
| 138 | + self.ignored_attributes = ignored_attributes or [] |
141 | 139 | self.parent_item_id = parent_item_id |
142 | 140 | if self.rp_supports_parameters: |
143 | 141 | self.ignored_attributes = list( |
144 | | - set(ignored_attributes).union({'parametrize'})) |
| 142 | + set(self.ignored_attributes).union({'parametrize'})) |
145 | 143 | self.log_batch_size = log_batch_size |
146 | 144 | log.debug('ReportPortal - Init service: endpoint=%s, ' |
147 | 145 | 'project=%s, uuid=%s', endpoint, project, uuid) |
@@ -392,6 +390,7 @@ def finish_launch(self, status=None, **kwargs): |
392 | 390 | } |
393 | 391 | log.debug('ReportPortal - Finish launch: request_body=%s', fl_rq) |
394 | 392 | self.rp.finish_launch(**fl_rq) |
| 393 | + self.rp = None |
395 | 394 |
|
396 | 395 | def post_log(self, message, loglevel='INFO', attachment=None): |
397 | 396 | """ |
|
0 commit comments