Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-29569: threading.Timer class: Continue periodical execution till action return True #121

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

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix for threading tests for Timer class
  • Loading branch information
slytomcat committed Feb 15, 2017
commit cfac9a122a840bac637fe28998d00c20058cd825
7 changes: 6 additions & 1 deletion 7 Lib/test/test_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,11 @@ def test_init_immutable_default_args(self):

def test_continuous_execution(self):
timer = threading.Timer(0.01, self._callback_cont)
self.callback_event.wait(0.1)
self.callback_event.clear()
timer.start()
for i in range(3):
self.callback_event.wait(1)
self.callback_event.clear()
self.assertEqual(self.callback_cnt, 0)

def _callback_spy(self, *args, **kwargs):
Expand All @@ -1094,6 +1098,7 @@ def _callback_spy(self, *args, **kwargs):

def _callback_cont(self):
self.callback_cnt -= 1
self.callback_event.set()
return self.callback_cnt > 0

class LockTests(lock_tests.LockTests):
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.