From 7a4ca47ddfc7acd6263a7abd2883d52bfa202371 Mon Sep 17 00:00:00 2001 From: Joakim Soderlund Date: Sat, 26 Feb 2022 17:00:38 +0100 Subject: [PATCH] Fix typing error after pytest upgrade --- tests/fixtures/responses.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fixtures/responses.py b/tests/fixtures/responses.py index 02e555b..29f978e 100644 --- a/tests/fixtures/responses.py +++ b/tests/fixtures/responses.py @@ -30,7 +30,7 @@ from typing import Any, ContextManager, Dict, Iterator, Optional, Union, Type import importlib_resources as resources import pytest -from _pytest.fixtures import FixtureRequest +from pytest import FixtureRequest from requests import Session, Response from requests.sessions import PreparedRequest from requests_mock import Mocker @@ -177,7 +177,7 @@ def responses(request: FixtureRequest) -> Iterator[Union[Recorder, Responder]]: Mocks or saves HTTP responses. """ real = environ.get('REAL_HTTP', '').lower() - name = request.fspath.basename[:-3] + '.json' + name = request.path.with_suffix('.json').name package = request.module.__package__ context: Type[Union[Recorder, Responder]]