Open LucidDan opened 2 years ago
Along with this one, I found a few other issues with specification compliance - I made a draft PR #50 that provides tests for as much of the ASGI spec as I could cover. There are xfail that demonstrate a few areas where the package doesn't follow the spec.
Of those xfails, five stand out as worthy of special mention, I think:
This package currently treats lifespan protocol as mandatory - if the application raises an exception in a lifespan.startup message, it treats the testclient as failed.
The ASGI spec states:
So to test correctly, the TestClient should really allow an ASGI application to raise an exception, and if so then continue without sending any further lifespan messages, including on aexit.