-
Notifications
You must be signed in to change notification settings - Fork 68
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
chore: add showcase e2e tests for async rest #2167
Conversation
aaacccd
to
279fc56
Compare
gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/__init__.py.j2
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This issue link and any follow up links within this file will be updated to:
#2168
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only non-trivial comment is about the alternative templates. Please address/discuss that before merging.
gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/__init__.py.j2
Show resolved
Hide resolved
@@ -50,7 +51,7 @@ async def test_client_async(async_echo): | |||
@pytest.mark.asyncio | |||
async def test_client_destroyed_async(async_echo): | |||
await async_echo.__aexit__(None, None, None) | |||
with pytest.raises(grpc._cython.cygrpc.UsageError): | |||
with pytest.raises((grpc._cython.cygrpc.UsageError, exceptions.TransportError)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious: how does pytest
decide what to pass to the echo
or async_echo
parameters in these test functions? I'm used to seeing the @parametrize
annotation, and I see there's also the pytest_generate_tests
option, but I don't see that in our codebase. So what's at play here? Is nox
somehow doing the work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what the ask here is exactly. echo
and async_echo
are defined as fixtures within conftest.py
.
Essentially, we pre-construct the clients (for the two transport types that we support which are parameterized) and then use them here in our test cases to call methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the information I needed: the parameters are filled in automatically by the fixtures we define in conftest.py
. (I haven't internalized all the pytest
usage patterns yet. ;-) )
279fc56
to
25e16e9
Compare
439152e
to
cb8372b
Compare
cb8372b
to
7043f26
Compare
No description provided.