Skip to content

Commit

Permalink
Initialize 'StreamingPullFuture._cancelled' as True (#6901)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoais authored and tseaver committed Dec 12, 2018
1 parent 242e407 commit 2a6b38e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pubsub/google/cloud/pubsub_v1/subscriber/futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, manager):
super(StreamingPullFuture, self).__init__()
self._manager = manager
self._manager.add_close_callback(self._on_close_callback)
self._cancelled = True
self._cancelled = False

def _on_close_callback(self, manager, result):
if result is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def test_default_state(self):

assert future.running()
assert not future.done()
assert not future.cancelled()
future._manager.add_close_callback.assert_called_once_with(
future._on_close_callback
)
Expand Down

0 comments on commit 2a6b38e

Please sign in to comment.