Closed otsuka closed 4 years ago
Merging #30 into master will increase coverage by
0.25%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #30 +/- ##
==========================================
+ Coverage 85.89% 86.14% +0.25%
==========================================
Files 6 6
Lines 397 397
==========================================
+ Hits 341 342 +1
+ Misses 56 55 -1
Impacted Files | Coverage Δ | |
---|---|---|
async_asgi_testclient/websocket.py | 68.29% <100%> (+1.21%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 2140474...cd1b1b2. Read the comment docs.
Can you add a test for this use-case?
I added a test.
BTW, you give a float value to the timeout
parameter of TestClient in test code,
async with TestClient(starlette_app, timeout=0.1) as client:
but the TestClient's timeout
parameter type is defined as int
def __init__(
self,
application,
use_cookies: bool = True,
timeout: Optional[int] = None,
headers: Optional[Union[dict, CIMultiDict]] = None,
scope: Optional[dict] = None,
):
Hmm, you are right. I'll fix it!
Released 1.4.2 with the annotation fix
In
WebSocketSession.connect()
method, check ifself.cookies
is None to use TestClient.cookie_jar. Butself.cookies
is never be None because the lineself.cookies = cookies or {}
exists in its constructor.