Skip to content

Commit ea33cba

Browse files
authored
Merge pull request #166 from iivanou/pytest_method_missing
Reflect get_actual_log_level() name change in Pytest package version 5.4.0
2 parents 47e3fe3 + 1c4da41 commit ea33cba

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

pytest_reportportal/plugin.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import logging
55
import dill as pickle
6+
import pkg_resources
67
import pytest
78
import requests
89
import time
@@ -12,9 +13,15 @@
1213

1314
try:
1415
# This try/except can go away once we support pytest >= 3.3
15-
import _pytest.logging
16+
pkg_resources.get_distribution('pytest >= 3.3.0')
1617
PYTEST_HAS_LOGGING_PLUGIN = True
17-
except ImportError:
18+
try:
19+
# This try/except can go away once we support pytest >= 5.4.0
20+
from _pytest.logging import get_actual_log_level
21+
except ImportError:
22+
from _pytest.logging import get_log_level_for_setting as \
23+
get_actual_log_level
24+
except pkg_resources.VersionConflict:
1825
PYTEST_HAS_LOGGING_PLUGIN = False
1926

2027
log = logging.getLogger(__name__)
@@ -157,7 +164,7 @@ def pytest_configure(config):
157164
# set Pytest_Reporter and configure it
158165
if PYTEST_HAS_LOGGING_PLUGIN:
159166
# This check can go away once we support pytest >= 3.3
160-
log_level = _pytest.logging.get_actual_log_level(config, 'rp_log_level')
167+
log_level = get_actual_log_level(config, 'rp_log_level')
161168
if log_level is None:
162169
log_level = logging.NOTSET
163170
else:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def read_file(fname):
88
return f.read()
99

1010

11-
version = '1.10.0'
11+
version = '1.10.1'
1212

1313

1414
requirements = [

0 commit comments

Comments
 (0)