Skip to content

Commit cddab37

Browse files
author
Ivan Ivanou
committed
Fix import issues for Pytest < 3.4.0
1 parent c430a41 commit cddab37

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pytest_reportportal/service.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@
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+
1117
from _pytest.python import Class, Function, Instance, Module
1218
from _pytest.unittest import TestCaseFunction, UnitTestCase
1319
from _pytest.warning_types import PytestWarning

0 commit comments

Comments
 (0)