-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add a way to notify test code that all handers were executed #3
Comments
Well, in this case I assume that the 3rd party software is doing the request in a separate thread or a process. Is that right? |
We are writing tests for our main product which is written in C++. The request is made in response to request that I'm sending to this program using requests. So, firstly, communication between Python and C++ application is not simple, secondly, we want to test it without knowing implementation details. Do you have other proposals? |
I propose to store |
Also, it to would be great to combine it somehow with |
In Linux you can wait for an file descriptor, thread or process. If you don't have any of these, only the polling will remain, however if you are creating the thread or the process from python directly, I would still suggest waiting on that object (fd, thread, process). |
What's wrong with the method I described in #3 (comment)? Will you accept my patch implementing this? |
If you have a patch for this, that would help me to understand your solution. I think I haven't understood fully what you need and that would help. I can't make any guarantee that the patch will be accepted but I'm ok with using threading events. |
I'll be off the grid for a few days, so don't expect timely response from me. I can get back to you mid next week. |
Now we have code like this:
where
wait_for_truthy
is a function that periodically calls its first argument until either the result becomesTrue
or a timeout occurs.This solution is not very beautiful and fast. Do you have ideas about how to do this properly?
The text was updated successfully, but these errors were encountered: