question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Move tests to pytest-grpc

See original GitHub issue

https://github.com/kataev/pytest-grpc

This will allow invoking servicers directly with pytest --grpc-fake-server for nicer error tracing and speed boost.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
kalvdanscommented, Aug 22, 2020

Thanks! Then I will go on with it and clean it up 😃

1reaction
aapelivcommented, Aug 20, 2020

Just to clarify: when they made that plugin, there was no interceptor support in gRPC. They’ve since added that support, and indeed, it’s easy now to use that to verify a user has a valid bearer token.

The tricky part is in propagating the user_id down to the RPC handlers through the context. That’s the part I didn’t figure out how to do without this custom interceptor code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

kataev/pytest-grpc: Allow test gRPC with pytest - GitHub
pytest -grpc · Example · Usage · Run tests against real gRPC server · Run tests directly to python code · Run the...
Read more >
How to write a GRPC python unittest - Stack Overflow
In Java, we can use InprocessServerBuilder for unittest. However, I haven't find a similar class in Python. Can any one provide a sample...
Read more >
How to unittest grpc client ? (Python) : r/learnpython - Reddit
Hello, I wrote this small client and I am supposed to write unittest for it. What would you write ? I dont even...
Read more >
Test gRPC - Jupyter Tutorial 0.9.0
gRPC can be tested automatically with pytest-grpc. First, we install. $ pipenv install pytest-grpc Installing pytest-grpc… Adding pytest ...
Read more >
pytest Documentation - Read the Docs
2.18 How to use unittest-based tests with pytest . ... successful state-changing action gets torn down by moving it to a ... pytest-grpc....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found