Skip to content

Increase test coverage for pstats.py #57879

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
andreacrotti mannequin opened this issue Dec 28, 2011 · 7 comments
Closed

Increase test coverage for pstats.py #57879

andreacrotti mannequin opened this issue Dec 28, 2011 · 7 comments
Labels
easy tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@andreacrotti
Copy link
Mannequin

andreacrotti mannequin commented Dec 28, 2011

BPO 13670
Nosy @birkenfeld, @briancurtin, @iritkatriel
Files
  • test_pstats.diff
  • 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 = None
    created_at = <Date 2011-12-28.14:13:28.618>
    labels = ['easy', 'type-feature', 'tests']
    title = 'Increase test coverage for pstats.py'
    updated_at = <Date 2022-03-22.21:55:07.934>
    user = 'https://bugs.python.org/andreacrotti'

    bugs.python.org fields:

    activity = <Date 2022-03-22.21:55:07.934>
    actor = 'iritkatriel'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Tests']
    creation = <Date 2011-12-28.14:13:28.618>
    creator = 'andrea.crotti'
    dependencies = []
    files = ['24098']
    hgrepos = []
    issue_num = 13670
    keywords = ['easy', 'newcomer friendly']
    message_count = 6.0
    messages = ['150290', '150291', '150292', '221790', '338076', '415821']
    nosy_count = 4.0
    nosy_names = ['georg.brandl', 'brian.curtin', 'andrea.crotti', 'iritkatriel']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue13670'
    versions = ['Python 3.5']

    Linked PRs

    @andreacrotti
    Copy link
    Mannequin Author

    andreacrotti mannequin commented Dec 28, 2011

    This patch increases test coverage for pstats.py from 25 to 36%.

    It's my first proposed patch so sorry in advance if there are problems. Much more can be done for pstats.py (which is also not much commented) but I want to get some feedback on this first..

    @andreacrotti andreacrotti mannequin added tests Tests in the Lib/test dir type-feature A feature request or enhancement labels Dec 28, 2011
    @birkenfeld
    Copy link
    Member

    I don't understand this comment:
    + #TODO: add more complicated tests, which might almost compile

    Also, please don't use docstrings for the test methods because of unittest's "feature" to display them instead of the test method names.

    @andreacrotti
    Copy link
    Mannequin Author

    andreacrotti mannequin commented Dec 28, 2011

    It's really hard to understand true, and if should not go in the patch in general of course.

    The sense was that the only test I added is trivial, but I haven't produced something better yet.

    And ok I will remove the docstrings, I was actually doing it on purpose thinking about the unittest feature, but if the name is clear enough than is better to leave the docstring out...

    Another thing, I didn't want to use tempfile.mktemp to generate a temporary file, but dump_stats doesn't accept anything else, is it in general safe to use it in this case?

    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Jun 28, 2014

    @Andrea assuming that you get an answer to the question you posed in msg150292, will you follow up on this?

    @andreacrotti
    Copy link
    Mannequin Author

    andreacrotti mannequin commented Mar 16, 2019

    It has been a long time but if it's still useful sure.

    I can see some tests have been added in commit 863b1e4
    but if these are still relevant I'm happy to go ahead.

    @iritkatriel
    Copy link
    Member

    The patch needs to be reviewed. If the tests are still relevant and increase coverage, it needs to be converted to a GitHub PR. Otherwise this issue can be closed.

    @corona10
    Copy link
    Member

    Now we can close the issue.

    @tigercosmos
    Thanks for the contribution!

    @gaogaotiantian
    Thanks for the review!

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    easy tests Tests in the Lib/test dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants