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

Increase test coverage for timeit.py #55787

Closed
michaelhenry mannequin opened this issue Mar 16, 2011 · 9 comments
Closed

Increase test coverage for timeit.py #55787

michaelhenry mannequin opened this issue Mar 16, 2011 · 9 comments
Labels
stdlib Python modules in the Lib dir

Comments

@michaelhenry
Copy link
Mannequin

michaelhenry mannequin commented Mar 16, 2011

BPO 11578
Nosy @rhettinger, @merwok, @bitdancer, @skrah, @serhiy-storchaka, @koobs
Files
  • timeit_unit_test.patch: Adds test_timeit.py
  • 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 = None
    closed_at = <Date 2015-01-31.07:52:39.595>
    created_at = <Date 2011-03-16.20:27:06.567>
    labels = ['library']
    title = 'Increase test coverage for timeit.py'
    updated_at = <Date 2015-01-31.07:52:39.594>
    user = 'https://bugs.python.org/michaelhenry'

    bugs.python.org fields:

    activity = <Date 2015-01-31.07:52:39.594>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-01-31.07:52:39.595>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2011-03-16.20:27:06.567>
    creator = 'michael.henry'
    dependencies = []
    files = ['21251']
    hgrepos = []
    issue_num = 11578
    keywords = ['patch']
    message_count = 9.0
    messages = ['131171', '131180', '131181', '131185', '131305', '234730', '234967', '235049', '235066']
    nosy_count = 8.0
    nosy_names = ['rhettinger', 'eric.araujo', 'r.david.murray', 'skrah', 'python-dev', 'michael.henry', 'serhiy.storchaka', 'koobs']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue11578'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3']

    @michaelhenry
    Copy link
    Mannequin Author

    michaelhenry mannequin commented Mar 16, 2011

    The timeit.py module has no specific tests. The attached patch adds
    Lib/test/test_timeit.py for unit testing, along with slight modifications
    to timeit.py to support predictable unit testing.

    @michaelhenry michaelhenry mannequin added the stdlib Python modules in the Lib dir label Mar 16, 2011
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 16, 2011

    New changeset 628a3679dc14 by R David Murray in branch '3.2':
    bpo-11578: add unit tests for timeit module.
    http://hg.python.org/cpython/rev/628a3679dc14

    New changeset 2f443a200b8c by R David Murray in branch 'default':
    Merge bpo-11578 test from 3.2.
    http://hg.python.org/cpython/rev/2f443a200b8c

    @bitdancer
    Copy link
    Member

    We commented out a few of the tests because they took too long to run due to the large default loop count. timeit would have to be further modified to support testing the default, which probably isn't worth it.

    @michaelhenry
    Copy link
    Mannequin Author

    michaelhenry mannequin commented Mar 16, 2011

    Issue bpo-5633 contains two additional unit tests that can't be added until
    that ticket's bug is fixed.

    @michaelhenry michaelhenry mannequin reopened this Mar 16, 2011
    @merwok
    Copy link
    Member

    merwok commented Mar 18, 2011

    Is there no resource (in the regrtest machinery) that could be used to flag those intensive tests?

    Nit: the NEWS entry lacks a “by”.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jan 26, 2015

    New changeset 7e7c825f75ad by Serhiy Storchaka in branch '2.7':
    Issue bpo-11578: Backported test for the timeit module.
    https://hg.python.org/cpython/rev/7e7c825f75ad

    @koobs
    Copy link

    koobs commented Jan 29, 2015

    7e7c825f75ad832d973542bfcf9ecd6e5dd3f981 broke koobs-freebsd9 and koobs-freebsd10, with:

    ======================================================================
    FAIL: test_main_exception (test.test_timeit.TestTimeit)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/usr/home/buildbot/python/2.7.koobs-freebsd9/build/Lib/test/test_timeit.py", line 300, in test_main_exception
        self.assert_exc_string(error_stringio.getvalue(), 'ZeroDivisionError')
      File "/usr/home/buildbot/python/2.7.koobs-freebsd9/build/Lib/test/test_timeit.py", line 195, in assert_exc_string
        self.assertTrue(exc_lines[0].startswith('Traceback'))
    AssertionError: False is not true

    @koobs koobs reopened this Jan 29, 2015
    @skrah
    Copy link
    Mannequin

    skrah mannequin commented Jan 30, 2015

    I think all 2.7 bots are broken. :)

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jan 31, 2015

    New changeset aa6f8e067ec3 by Serhiy Storchaka in branch '2.7':
    Use float division to avoid deprecation warning in test_timeit (issue bpo-11578).
    https://hg.python.org/cpython/rev/aa6f8e067ec3

    @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
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants