Skip to content

Commit 0e12d37

Browse files
author
Dmitriy Gumeniuk
authored
Merge branch 'master' into logging_fix
2 parents 02661ed + 3f66f5c commit 0e12d37

File tree

4 files changed

+31
-7
lines changed

4 files changed

+31
-7
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ Copyright Notice
231231
----------------
232232
.. Copyright Notice: https://github.com/reportportal/agent-python-pytest#copyright-notice
233233
234-
Licensed under the GPLv3_ license (see the LICENSE file).
234+
Licensed under the `Apache 2.0`_ license (see the LICENSE file).
235235

236-
.. _GPLv3: https://www.gnu.org/licenses/quick-guide-gplv3.html
236+
.. _Apache 2.0: https://www.apache.org/licenses/LICENSE-2.0
237237

pytest_reportportal/errors.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""This module includes exceptions used in the package."""
2+
3+
4+
class PytestWarning(UserWarning):
5+
"""Pytest warning exception.
6+
7+
This exception is about to stub absent PytestWarning in Pytest versions
8+
up to 3.8.0. Get rid of this code once we drop support for Pytest versions
9+
below 3.8.0.
10+
"""
11+
pass

pytest_reportportal/listener.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def _add_issue_info(self, item, report):
112112

113113
issue_type = "TI" if issue_type is None else issue_type
114114

115-
if issue_type and self.PyTestService.issue_types \
115+
if issue_type and getattr(self.PyTestService, 'issue_types', False) \
116116
and (issue_type in self.PyTestService.issue_types):
117117
if comment:
118118
self.issue['comment'] = comment

pytest_reportportal/service.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,23 @@
77
import pytest
88
from _pytest.doctest import DoctestItem
99
from _pytest.main import Session
10-
from _pytest.nodes import File, Item
10+
11+
try:
12+
pkg_resources.get_distribution('pytest >= 3.4.0')
13+
from _pytest.nodes import File, Item
14+
except pkg_resources.VersionConflict:
15+
from _pytest.main import File, Item
16+
17+
try:
18+
pkg_resources.get_distribution('pytest >= 3.8.0')
19+
from _pytest.warning_types import PytestWarning
20+
except pkg_resources.VersionConflict:
21+
from pytest_reportportal.errors import PytestWarning
22+
23+
1124
from _pytest.python import Class, Function, Instance, Module
1225
from _pytest.unittest import TestCaseFunction, UnitTestCase
13-
from _pytest.warning_types import PytestWarning
26+
1427
from reportportal_client import ReportPortalServiceAsync
1528
from six import with_metaclass
1629
from six.moves import queue
@@ -94,8 +107,8 @@ def init_service(self, endpoint, project, uuid, log_batch_size,
94107
token=uuid,
95108
error_handler=self.async_error_handler,
96109
retries=retries,
97-
log_batch_size=log_batch_size # ,
98-
# verify_ssl=verify_ssl
110+
log_batch_size=log_batch_size,
111+
verify_ssl=verify_ssl
99112
)
100113
if self.RP and hasattr(self.RP.rp_client, "get_project_settings"):
101114
self.project_settings = self.RP.rp_client.get_project_settings()

0 commit comments

Comments
 (0)