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

Refactor test_threadedtempfile.py to use unittest. #44635

Closed
jerryseutter mannequin opened this issue Feb 28, 2007 · 9 comments
Closed

Refactor test_threadedtempfile.py to use unittest. #44635

jerryseutter mannequin opened this issue Feb 28, 2007 · 9 comments
Labels
tests Tests in the Lib/test dir

Comments

@jerryseutter
Copy link
Mannequin

jerryseutter mannequin commented Feb 28, 2007

BPO 1670993
Files
  • test_threadedtempfile.py.patch: patch v1
  • test_threadedtempfile.py.patch: patch v2 - cleanup old style print error
  • 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 2007-03-12.17:25:25.000>
    created_at = <Date 2007-02-28.15:41:53.000>
    labels = ['tests']
    title = 'Refactor test_threadedtempfile.py to use unittest.'
    updated_at = <Date 2007-03-12.17:25:25.000>
    user = 'https://bugs.python.org/jerryseutter'

    bugs.python.org fields:

    activity = <Date 2007-03-12.17:25:25.000>
    actor = 'collinwinter'
    assignee = 'collinwinter'
    closed = True
    closed_date = None
    closer = None
    components = ['Tests']
    creation = <Date 2007-02-28.15:41:53.000>
    creator = 'jerry.seutter'
    dependencies = []
    files = ['7806', '7807']
    hgrepos = []
    issue_num = 1670993
    keywords = ['patch']
    message_count = 9.0
    messages = ['51998', '51999', '52000', '52001', '52002', '52003', '52004', '52005', '52006']
    nosy_count = 2.0
    nosy_names = ['collinwinter', 'jerry.seutter']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1670993'
    versions = ['Python 2.6']

    @jerryseutter
    Copy link
    Mannequin Author

    jerryseutter mannequin commented Feb 28, 2007

    This patch turns test_threadedtempfile.py into a unittest test file. There should be no changes in what the file tests. Input on this patch is welcome before I go too far on more of the old test files.

    @jerryseutter jerryseutter mannequin closed this as completed Feb 28, 2007
    @jerryseutter jerryseutter mannequin added the tests Tests in the Lib/test dir label Feb 28, 2007
    @jerryseutter
    Copy link
    Mannequin Author

    jerryseutter mannequin commented Feb 28, 2007

    Lib/test/output/test_threadedtempfile should also be removed when this patch is applied.

    @collinwinter
    Copy link
    Mannequin

    collinwinter mannequin commented Mar 6, 2007

    Why did you get rid of the -t/-f options?

    @jerryseutter
    Copy link
    Mannequin Author

    jerryseutter mannequin commented Mar 6, 2007

    I removed the -t/-f options mostly because in the short time I spent trying to handle both -t/-f and unittest.main(), it seemed like the options were messing up unittest. I asked about removing the command line processing on this file at the PyCon sprint and the people there thought it would be okay to remove them. Their argument was that the files that match output to the output/ directory haven't been refactored in a long time, probably aren't maintained much (other than when they break), and probably aren't used much. Since the intended audience of this file is a developer, they wouldn't have a difficult time manually changing the global variables for this setting located at the top of the file.

    Having said that, if someone uses this functionality, I'll try adding it back in. Thoughts?

    @collinwinter
    Copy link
    Mannequin

    collinwinter mannequin commented Mar 6, 2007

    They can stay out; I just wanted to know the reason. This patch looks good to me.

    @collinwinter
    Copy link
    Mannequin

    collinwinter mannequin commented Mar 11, 2007

    One question before I apply this: why did you leave

    if t.error_count:
         print '%s errors:\n%s' % (t.getName(), t.errors.getvalue())

    in ThreadedTempFileTest.test_main()? Why not make it some kind of assertion?

    @jerryseutter
    Copy link
    Mannequin Author

    jerryseutter mannequin commented Mar 12, 2007

    File Added: test_threadedtempfile.py.patch

    @jerryseutter
    Copy link
    Mannequin Author

    jerryseutter mannequin commented Mar 12, 2007

    RE:

    One question before I apply this: why did you leave

    if t.error_count:
    print '%s errors:\n%s' % (t.getName(), t.errors.getvalue())

    I missed that line - removed it and made the final assert more useful. See patch v2.

    @collinwinter
    Copy link
    Mannequin

    collinwinter mannequin commented Mar 12, 2007

    I added an assert for 'ok', committed the result as r54295. Thanks for the patch!

    @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

    0 participants