bugsnag / bugsnag-python

Official BugSnag error monitoring and error reporting for django, flask, tornado and other python apps.
https://docs.bugsnag.com/platforms/python/
MIT License
84 stars 42 forks source link

Fix ASGI test #370

Closed imjoehaines closed 7 months ago

imjoehaines commented 7 months ago

Goal

The client scope was removed in https://github.com/encode/starlette/pull/2377 when using the TestClient, which means we no longer get a clientIp key in request metadata when running unit tests

This is still set outside of a testing environment and is still covered by a different unit test:

https://github.com/bugsnag/bugsnag-python/blob/b22ab1fa819cb46ae45d80c92c27b5bc086e514d/tests/integrations/test_async_asgi.py#L112