mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
fix: Fix pytest-asyncio compatibility issues
- Remove loop_scope parameter from pytest.mark.asyncio (not supported in 1.2.0) - Remove asyncio_mode and asyncio_default_fixture_loop_scope config options - Tests now running successfully (6 passed in quick test)
This commit is contained in:
@@ -137,8 +137,6 @@ replacement = '[\1](https://github.com/hanzoai/python-sdk/tree/main/\g<2>)'
|
||||
testpaths = ["tests"]
|
||||
addopts = "--tb=short"
|
||||
xfail_strict = true
|
||||
asyncio_mode = "auto"
|
||||
asyncio_default_fixture_loop_scope = "session"
|
||||
filterwarnings = [
|
||||
"error",
|
||||
"ignore:OpenTelemetry configuration.*is not supported by Datadog:UserWarning",
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ logging.getLogger("hanzoai").setLevel(logging.DEBUG)
|
||||
# so we don't have to add that boilerplate everywhere
|
||||
def pytest_collection_modifyitems(items: list[pytest.Function]) -> None:
|
||||
pytest_asyncio_tests = (item for item in items if is_async_test(item))
|
||||
session_scope_marker = pytest.mark.asyncio(loop_scope="session")
|
||||
session_scope_marker = pytest.mark.asyncio()
|
||||
for async_test in pytest_asyncio_tests:
|
||||
async_test.add_marker(session_scope_marker, append=False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user