Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_client fixture clashes with pytest-aiohttp #22

Closed
burnpanck opened this issue Sep 11, 2018 · 5 comments
Closed

test_client fixture clashes with pytest-aiohttp #22

burnpanck opened this issue Sep 11, 2018 · 5 comments

Comments

@burnpanck
Copy link

If both pytest-sanic and pytest-aiohttp are installed, tests may pick up the wrong fixture. While this clearly is a design problem of pytest's magic fixture identification by name itself (pytest-dev/pytest#3966, pytest-dev/pytest#3834), pytest-sanic could help here by choosing a different name.

@yunstanford
Copy link
Owner

@burnpanck yeah, sure, we can change the fixture name if needed, but it doesn't fix the issue essentially.

Also, is there any reason you wanna install both pytest-sanic and pytest-aiohttp into one virtualenv ?

@burnpanck
Copy link
Author

I have an internal web-based api. The client and server implementations are in the same repository. The server is based on sanic, while the client uses aiohttp. Naturally, I want to test both ends. I could probably make a tox configuration that tests the server and the client in suitable separate environments. Right now, I simply don't use the test_client in either of the two, but create copy-paste versions of both implementations locally using suitable names.

@yunstanford
Copy link
Owner

Hey, we can start add a new fixture with a different name, and start to deprecate test_client

@kataev
Copy link

kataev commented Dec 24, 2018

Hello, when new version with new fixture client name will be released?
Without it, i must copy-paste test_client fixture with another name in my code, i think this it not a good solution.

@yunstanford
Copy link
Owner

Addressed in 1.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants