| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| For each message, schedule a callback with the executor. | ||
| """ | ||
| def callback_completed(future): | ||
| logger.debug('Result: %s' % future.result()) |
|
@lukesneeringer NP! Funny, though, I was just working on a unit test to test that the calls actually happen asynchronously... Should I continue with that and open a new PR? |
Sorry, something went wrong.
|
It would be along the lines of: def test_on_response():
call_times = []
def side_effect(*args, **kwargs):
# list.append() is thread-safe.
call_times.append(datetime.now())
time.sleep(2)
callback = mock.Mock(spec=())
callback.side_effect = side_effect
# Then, after the calls happen, test that the times are both more than a second ago, or something like that...
|
Sorry, something went wrong.
|
I would accept that as a system test (but not a unit test). :-) And yes, additional PR is of course welcome. |
Sorry, something went wrong.
|
P. S. pubsub 0.28.4 is going through CI to release now. (This was a serious enough bug that I wanted it out immediately.) |
Sorry, something went wrong.
|
@lukesneeringer The Pub / Sub unit tests seem to be broken (or heisen-broken) on Python 2.7: |
Sorry, something went wrong.
…allbacks to complete. Guessing this test was succeeding before because of the bug fixed in googleapis#4174 itself.
| Back | FazBrowse Home | New Git URL |
Closes #4167