Browse Source

Fixed usage of warnings.catch_warnings in a way that is not compatible with older python versions

pull/12529/head
Nir Schulman 9 months ago
parent
commit
6c923ac4ec
  1. 3
      tests/test_lifespan_scoped_dependencies/test_endpoint_usage.py

3
tests/test_lifespan_scoped_dependencies/test_endpoint_usage.py

@ -573,7 +573,8 @@ def test_lifespan_scoped_dependency_can_be_used_alongside_custom_lifespans(
app = FastAPI(lifespan=lifespan)
elif lifespan_style == "events_decorator":
app = FastAPI()
with warnings.catch_warnings(action="ignore", category=DeprecationWarning):
with warnings.catch_warnings(record=True):
warnings.simplefilter("always")
@app.on_event("startup")
async def startup() -> None:

Loading…
Cancel
Save