Skip to content

Commit 9ffed40

Browse files
committed
feat(CFMTech#46): Remove support for pytest <= 5
1 parent bd55b75 commit 9ffed40

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pytest_monitor/pytest_monitor.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"monitor_test_if": (True, "monitor_force_test", lambda x: bool(x), False),
2323
}
2424
PYTEST_MONITOR_DEPRECATED_MARKERS = {}
25-
PYTEST_MONITOR_ITEM_LOC_MEMBER = "_location" if tuple(pytest.__version__.split(".")) < ("5", "3") else "location"
2625

2726
PYTEST_MONITORING_ENABLED = True
2827

@@ -288,7 +287,7 @@ def _prf_module_tracer(request):
288287

289288

290289
@pytest.fixture(autouse=True)
291-
def _prf_tracer(request):
290+
def _prf_tracer(request: pytest.FixtureRequest):
292291
if not PYTEST_MONITORING_ENABLED:
293292
yield
294293
else:
@@ -297,7 +296,7 @@ def _prf_tracer(request):
297296
ptimes_b = request.session.pytest_monitor.process.cpu_times()
298297
if not request.node.monitor_skip_test and getattr(request.node, "monitor_results", False):
299298
item_name = request.node.originalname or request.node.name
300-
item_loc = getattr(request.node, PYTEST_MONITOR_ITEM_LOC_MEMBER)[0]
299+
item_loc, *_ = request.node.location
301300
request.session.pytest_monitor.add_test_info(
302301
item_name,
303302
request.module.__name__,

0 commit comments

Comments
 (0)