Skip to content

Commit c28a634

Browse files
committed
Pytest 7.0 fix
1 parent 816d7e4 commit c28a634

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pytest_reportportal/service.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,23 @@
99
from _pytest.doctest import DoctestItem
1010
from _pytest.main import Session
1111
from _pytest.nodes import File, Item
12-
from _pytest.python import Class, Function, Instance, Module
1312
from _pytest.unittest import TestCaseFunction, UnitTestCase
1413
from _pytest.warning_types import PytestWarning
14+
from pytest import Class, Function, Module
15+
16+
try:
17+
from pytest import Instance
18+
except ImportError:
19+
# in pytest >= 7.0 this type was removed
20+
Instance = type('dummy', (), {})
1521
from reportportal_client import ReportPortalService
1622
from reportportal_client.external.google_analytics import send_event
1723
from reportportal_client.helpers import (
1824
gen_attributes,
1925
get_launch_sys_attrs,
2026
get_package_version
2127
)
28+
2229
from reportportal_client.service import _dict_to_payload
2330
from six import with_metaclass
2431

0 commit comments

Comments
 (0)