Fix deprecation warnings with pytest 9.1. (#7621)

This commit is contained in:
Andrey Rakhmatullin 2026-06-15 11:45:26 +05:00 committed by GitHub
parent 9893a7fac6
commit 4f241b73be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 5 deletions

View File

@ -906,16 +906,17 @@ class TestSimpleHttpsBase(ABC):
cipher_string: str | None = None
@pytest.fixture(scope="class")
def simple_mockserver(self) -> Generator[SimpleMockServer]:
@classmethod
def simple_mockserver(cls) -> Generator[SimpleMockServer]:
with SimpleMockServer(
self.keyfile, self.certfile, cipher_string=self.cipher_string
cls.keyfile, cls.certfile, cipher_string=cls.cipher_string
) as simple_mockserver:
yield simple_mockserver
@pytest.fixture(scope="class")
def url(self, simple_mockserver: SimpleMockServer) -> str:
# need to use self.host instead of what mockserver returns
return f"https://{self.host}:{simple_mockserver.port(is_secure=True)}/file"
@classmethod
def url(cls, simple_mockserver: SimpleMockServer) -> str:
return f"https://{cls.host}:{simple_mockserver.port(is_secure=True)}/file"
@property
@abstractmethod