Skip to content
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

sched.py module doesn't have a test suite #52933

Closed
giampaolo opened this issue May 11, 2010 · 6 comments
Closed

sched.py module doesn't have a test suite #52933

giampaolo opened this issue May 11, 2010 · 6 comments
Assignees
Labels
tests Tests in the Lib/test dir

Comments

@giampaolo
Copy link
Contributor

giampaolo commented May 11, 2010

BPO 8687
Nosy @josiahcarlson, @pitrou, @giampaolo
Files
  • test_sched.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/giampaolo'
    closed_at = <Date 2010-08-04.09:30:04.547>
    created_at = <Date 2010-05-11.12:28:04.621>
    labels = ['tests']
    title = "sched.py module doesn't have a test suite"
    updated_at = <Date 2010-08-04.09:30:04.545>
    user = 'https://github.com/giampaolo'

    bugs.python.org fields:

    activity = <Date 2010-08-04.09:30:04.545>
    actor = 'giampaolo.rodola'
    assignee = 'giampaolo.rodola'
    closed = True
    closed_date = <Date 2010-08-04.09:30:04.547>
    closer = 'giampaolo.rodola'
    components = ['Tests']
    creation = <Date 2010-05-11.12:28:04.621>
    creator = 'giampaolo.rodola'
    dependencies = []
    files = ['17296']
    hgrepos = []
    issue_num = 8687
    keywords = ['patch']
    message_count = 6.0
    messages = ['105503', '105514', '105613', '105614', '105615', '112777']
    nosy_count = 4.0
    nosy_names = ['josiahcarlson', 'pitrou', 'giampaolo.rodola', 'josiah.carlson']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue8687'
    versions = ['Python 3.2']

    @giampaolo
    Copy link
    Contributor Author

    giampaolo commented May 11, 2010

    sched.py module is currently lacking a test suite.
    Possibly this should be resolved before fixing bpo-8684.

    @giampaolo giampaolo added the tests Tests in the Lib/test dir label May 11, 2010
    @giampaolo
    Copy link
    Contributor Author

    giampaolo commented May 11, 2010

    Patch in attachment.

    @pitrou
    Copy link
    Member

    pitrou commented May 12, 2010

    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.

    @giampaolo
    Copy link
    Contributor Author

    giampaolo commented May 12, 2010

    I agree. Are you recommending to take advantage of this and change the tests in some way?

    @pitrou
    Copy link
    Member

    pitrou commented May 12, 2010

    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.

    @giampaolo giampaolo self-assigned this May 19, 2010
    @giampaolo
    Copy link
    Contributor Author

    giampaolo commented Aug 4, 2010

    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.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants