Skip to content

TestClient should expose app attribute #2891

Closed
@thomaszdxsn

Description

Long story short

I wrote my first test today, use pytest-aiohttp, fixture: aiohttp_client.

I don't want to follow doc by use hardcode URL, I think it is not a good practical pattern. I want to use app.route[].url_for().

And I found it need long access chain. like cli.server.app.route[].url_for().with_query().

Maybe should expose app attribute/property in TestClient instance?

Expected behaviour

can access app in client by client.app.

Actual behaviour

must access client.server.app

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