DataJunction / dj

A metrics platform.
http://datajunction.io
MIT License
29 stars 13 forks source link

Python client's `session` pytest fixture doesn't raise like the actual `session` #1002

Open anhqle opened 1 month ago

anhqle commented 1 month ago

DJClient sends request via RequestsSessionWithEndPoint, which raise_for_status() when it encounters errors https://github.com/DataJunction/dj/blob/0d8a10e9d324b7fe92675ca45fcea714abeff6db/datajunction-clients/python/datajunction/_internal.py#L105

In contrast, the session pytest fixture does NOT raise and just returns the response from the server (I think) https://github.com/DataJunction/dj/blob/9b56770b74366eb68a9dd300c3f95b414acc217a/datajunction-clients/python/tests/conftest.py#L244

This difference between fixture and the actual object causes misleading test results