-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Declare PROVISIONAL status for test_utils and pytest plugins #1154
Comments
👍 on declaring the api provisional. I think aiohttp's test utilities are already pretty good, but I agree that we shouldn't lock ourselves into test patterns that we've only tried out for a little while. As long as the apis are available, I'm happy (already using them :) ) I propose we just label all test apis provisional for now, until there's agreement among early adopters that this is the right way to go. I also agree that the connector parameter you propose is a little concerning: I personally hate function behavior that changes based on the type of object passed: it makes it harder to reason about what the function is actually doing. would it be possible to just provide two different constructors instead (static methods from_app and from_connector, or something like that). |
👍 fine with my. I would strongly suggest keeping the direct integration with pytest, it's by far the most user friendly and powerful test framework for python and having direct integration means aiohttp can do a much better job of holding people's hands as they start out with unit tests. But keeping the API provisional is fine. Splitting |
@samuelcolvin I love to support pytest. The library is just very trivial stub for getting rid of The actual code is:
I'm working hard on converting aiohttp tests into pytest way. |
Why another library outside aiohttp? Also isn't |
Unfortunately due weird I recall a mention of the problem in pytest docs but cannot find it now unfortunately. Maybe I'm wrong but just adding
into aiohttp's Also it's rude to add |
makes sense. |
Fixed by #1159 |
I've made a mistake by accepting #902 and #914 without very careful review and adopting aiohttp tests to using this technologies.
Both was published in
0.22
release.But after this on test rewriting others and I have found some quirks.
We have fixed one of them: after #1083
test_client
fixture acceptsapp
as well as factory.I believe the factory should be deprecated: the new api is much simpler and obvious.
After that I've split
TestClient
functionality into itself andTestServer
-- all is done for good and doesn't bring backward compatibility.The next spike is: on testing client I want to pass custom connector instance into the
test_client
fixture.We could add a
connector
param only if the first parameter isweb.Application
instance, not factory.But it's brings cognitive mess again. Maybe we'll find another problems in testing API in the near future.
Conclusion
Sorry for so long introduction.
I propose to:
Objections?
P.S.
@toumorokoshi and @samuelcolvin please don't get me wrong.
I've been very excited by your contributions into aiohttp testing tools.
The requested feature had had existed for very long ago.
I very appreciate your help.
Don't know when I was able to invest a time into the problem.
I just want to thank you.
But the first pancake is always lumpy, you know.
I have a feeling the support period for Test API solutions which are proven as not perfect should be reduced.
And we should not hesitate to break test API if keeping support of already presented solutions is not possible or maintenance burden is too high.
The text was updated successfully, but these errors were encountered: