This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2010年05月11日 12:28 by giampaolo.rodola, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| test_sched.patch | giampaolo.rodola, 2010年05月11日 13:57 | |||
| Messages (6) | |||
|---|---|---|---|
| msg105503 - (view) | Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) | Date: 2010年05月11日 12:28 | |
sched.py module is currently lacking a test suite. Possibly this should be resolved before fixing issue 8684. |
|||
| msg105514 - (view) | Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) | Date: 2010年05月11日 13:57 | |
Patch in attachment. |
|||
| msg105613 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年05月12日 23:49 | |
You know, one benefit of having user-settable sleep() and time() functions is that you can mock them easily, and therefore check that sched.py really schedules callables at the right intervals. |
|||
| msg105614 - (view) | Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) | Date: 2010年05月12日 23:51 | |
I agree. Are you recommending to take advantage of this and change the tests in some way? |
|||
| msg105615 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年05月12日 23:58 | |
> I agree. Are you recommending to take advantage of this and change the > tests in some way? Yes, it would allow you to check that if you have e.g. : - A scheduled in 1 s - B scheduled in 3 s sched.py first sleeps for 1 s, then calls A, then sleeps for 2 s, then calls B Twisted has a full-blown utility class that they use in many tests, allowing them to mock time.time(): http://twistedmatrix.com/documents/10.0.0/api/twisted.internet.task.Clock.html You probably don't need something as sophisticated, the idea of a class with advance() and time() methods is probably enough. |
|||
| msg112777 - (view) | Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) | Date: 2010年08月04日 09:30 | |
Committed as r83707 without including the mock time tests for now. I'll see whether I can manage to write them at a later time. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:00 | admin | set | github: 52933 |
| 2010年08月04日 09:30:04 | giampaolo.rodola | set | status: open -> closed resolution: fixed messages: + msg112777 versions: - Python 2.7 |
| 2010年05月19日 17:58:42 | giampaolo.rodola | set | assignee: giampaolo.rodola |
| 2010年05月12日 23:58:50 | pitrou | set | messages: + msg105615 |
| 2010年05月12日 23:51:59 | giampaolo.rodola | set | messages: + msg105614 |
| 2010年05月12日 23:49:03 | pitrou | set | messages: + msg105613 |
| 2010年05月11日 13:57:11 | giampaolo.rodola | set | files:
+ test_sched.patch keywords: + patch messages: + msg105514 |
| 2010年05月11日 13:07:31 | r.david.murray | unlink | issue8684 superseder |
| 2010年05月11日 13:07:31 | r.david.murray | link | issue8684 dependencies |
| 2010年05月11日 12:31:52 | giampaolo.rodola | link | issue8684 superseder |
| 2010年05月11日 12:28:04 | giampaolo.rodola | create | |