From c918e3d643db44acab963044b9da0c53e92f54aa Mon Sep 17 00:00:00 2001 From: Alexander Song Date: Thu, 7 Nov 2024 23:43:06 -0800 Subject: [PATCH] fix types --- tests/unit/vcr.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/unit/vcr.py b/tests/unit/vcr.py index e82ae6dedc4..010b6e7bb6e 100644 --- a/tests/unit/vcr.py +++ b/tests/unit/vcr.py @@ -1,5 +1,4 @@ import re -from pathlib import Path from typing import Any import vcr @@ -7,7 +6,7 @@ from vcr.cassette import Cassette -class CustomVCR(vcr.VCR): +class CustomVCR(vcr.VCR): # type: ignore[misc] def __init__( self, request: FixtureRequest, @@ -31,7 +30,7 @@ def use_cassette(self, **kwargs: Any) -> Cassette: module_name = self._request.node.module.__name__.split(".")[-1] test_name = self._request.node.name file_name_parts.append(_remove_parameters(test_name)) - test_file_path = Path(str(self._request.fspath)) + test_file_path = self._request.path path = ( test_file_path.parent / "cassettes" / module_name / f'{".".join(file_name_parts)}.yaml' )