Skip to content

aiohttp.test_utils.TestClient doesn't work with async with #2525

Closed
@barrachri

Description

Long story short

Testing websocket using a TestClient does not work as expected.

Expected behaviour

async with cli.ws_connect('http://localhost/ws') as ws:

should work, where cli is aiohttp.test_utils.TestClient

Actual behaviour

>       async with cli.ws_connect('/ws') as ws:
E       AttributeError: __aexit__

Steps to reproduce

Use async with a TestClient.ws_connect

Your environment

Python 3.6.3
aiohttp 2.3.2

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions