Page MenuHomeSoftware Heritage

D7512.id.diff
No OneTemporary

D7512.id.diff

diff --git a/swh/core/pytest_plugin.py b/swh/core/pytest_plugin.py
--- a/swh/core/pytest_plugin.py
+++ b/swh/core/pytest_plugin.py
@@ -11,7 +11,6 @@
from typing import Dict, List, Optional
from urllib.parse import unquote, urlparse
-from _pytest.fixtures import FixtureRequest
import pytest
import requests
from requests.adapters import BaseAdapter
@@ -119,7 +118,7 @@
@pytest.fixture
-def datadir(request: FixtureRequest) -> str:
+def datadir(request: pytest.FixtureRequest) -> str:
"""By default, returns the test directory's data directory.
This can be overridden on a per file tree basis. Add an override
@@ -135,7 +134,7 @@
"""
- return path.join(path.dirname(str(request.fspath)), "data")
+ return path.join(path.dirname(str(request.path)), "data")
def requests_mock_datadir_factory(
@@ -310,7 +309,7 @@
# stolen from pytest-flask, required to have url_for() working within tests
# using flask_app_client fixture.
@pytest.fixture(autouse=True)
-def _push_request_context(request: FixtureRequest):
+def _push_request_context(request: pytest.FixtureRequest):
"""During tests execution request context has been pushed, e.g. `url_for`,
`session`, etc. can be used in tests as is::
@@ -331,7 +330,7 @@
class FakeSocket(object):
- """ A fake socket for testing. """
+ """A fake socket for testing."""
def __init__(self):
self.payloads = deque()

File Metadata

Mime Type
text/plain
Expires
Mar 17 2025, 6:30 PM (7 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3222313

Event Timeline