mirror of https://github.com/scrapy/scrapy.git
Fix deprecation warnings with pytest 9.1. (#7621)
This commit is contained in:
parent
9893a7fac6
commit
4f241b73be
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue