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

IDLE: Add idlelib.config.IdleConf unittest #75100

Closed
mlouielu mannequin opened this issue Jul 13, 2017 · 12 comments
Closed

IDLE: Add idlelib.config.IdleConf unittest #75100

mlouielu mannequin opened this issue Jul 13, 2017 · 12 comments
Assignees
Labels
3.7 (EOL) end of life topic-IDLE type-feature A feature request or enhancement

Comments

@mlouielu
Copy link
Mannequin

mlouielu mannequin commented Jul 13, 2017

BPO 30917
Nosy @terryjreedy, @vstinner, @mlouielu
PRs
  • bpo-30917: IDLE: Add config.IdleConf unittest #2691
  • [3.6] bpo-30917: IDLE: Add config.IdleConf unittests (GH-2691) #2753
  • bpo-30917: IDLE: Fix mock_config deepcopy to read_string #2754
  • bpo-30968: Fix test_get_font in IDLE's test_config.  #2769
  • 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/terryjreedy'
    closed_at = <Date 2017-07-20.20:44:32.224>
    created_at = <Date 2017-07-13.06:40:58.718>
    labels = ['expert-IDLE', 'type-feature', '3.7']
    title = 'IDLE: Add idlelib.config.IdleConf unittest'
    updated_at = <Date 2017-07-20.20:44:32.192>
    user = 'https://github.com/mlouielu'

    bugs.python.org fields:

    activity = <Date 2017-07-20.20:44:32.192>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2017-07-20.20:44:32.224>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2017-07-13.06:40:58.718>
    creator = 'louielu'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 30917
    keywords = []
    message_count = 12.0
    messages = ['298266', '298267', '298385', '298576', '298616', '298618', '298625', '298638', '298669', '298694', '298707', '298749']
    nosy_count = 3.0
    nosy_names = ['terry.reedy', 'vstinner', 'louielu']
    pr_nums = ['2691', '2753', '2754', '2769']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue30917'
    versions = ['Python 3.6', 'Python 3.7']

    @mlouielu
    Copy link
    Mannequin Author

    mlouielu mannequin commented Jul 13, 2017

    Add idlelib.config.IdleConf unittest.

    @mlouielu mlouielu mannequin added the 3.7 (EOL) end of life label Jul 13, 2017
    @mlouielu mlouielu mannequin assigned terryjreedy Jul 13, 2017
    @mlouielu mlouielu mannequin added the topic-IDLE label Jul 13, 2017
    @mlouielu
    Copy link
    Mannequin Author

    mlouielu mannequin commented Jul 13, 2017

    After this unittest is merged, I would like to first cleanup config.py source code, then modify it more general way.

    @terryjreedy
    Copy link
    Member

    Yes, go ahead next with name changes and use of modern features such as sets and comprehensions. Please discuss 'general changes before coding. When we added Linux Modern keys a year ago, I combined two functions into IdleConf.current_colors_and_keys. I suspect that there are other duplications to remove.

    Except for extensions, current values in default configs should not change, as doing so will break past versions. So using them in tests is good, as it will detect unwanted changes to those files. I hope the list of extensions goes down, but when it does, we can change the tests.

    @terryjreedy terryjreedy added the type-feature A feature request or enhancement label Jul 15, 2017
    @terryjreedy
    Copy link
    Member

    Whatever is merged with PR_2691, further improvements can be made in further PRs either on this issue or others that work on config code.

    I still think this test is slower than it should be -- the change to deep copy either made no difference or made it slower, but I will try profiling before experimenting more.

    In config, the warning prints in the directory search should use _warn, which can be blocked and mocked while testing.

    4% uncovered in the file is probably 6% of IdleConf. At least some is error branches that might be interesting to trigger.

    @terryjreedy
    Copy link
    Member

    New changeset f776eb0 by terryjreedy (Louie Lu) in branch 'master':
    bpo-30917: IDLE: Add config.IdleConf unittests (bpo-2691)
    f776eb0

    @terryjreedy
    Copy link
    Member

    The deepcopy does not work on 3.6. Any fix should be applied to 3.7 as well. If nothing else, we should try to reload with read_string.

    This is a blocker for merging anything else into config and test_config.

    @mlouielu
    Copy link
    Mannequin Author

    mlouielu mannequin commented Jul 19, 2017

    PR 2754 changed it to use read_string.

    @terryjreedy
    Copy link
    Member

    Thanks. I will look at it tomorrow and if it seems ok, prepare a new combined backport and see if it passes.

    @vstinner
    Copy link
    Member

    Please see bpo-30968: "test_get_font (idlelib.idle_test.test_config.IdleConfTest) failure on x86 Windows7 3.x".

    @terryjreedy
    Copy link
    Member

    New changeset ed014f7 by terryjreedy (Louie Lu) in branch 'master':
    bpo-30917: IDLE: Fix mock_config deepcopy to read_string (bpo-2754)
    ed014f7

    @terryjreedy
    Copy link
    Member

    New changeset 65c24c8 by terryjreedy in branch '3.6':
    [3.6] bpo-30917: IDLE: Add config.IdleConf unittests (GH-2691) (bpo-2753)
    65c24c8

    @terryjreedy
    Copy link
    Member

    PR2769 is the fix for master for test_get_font for bpo-30968. The listing here is a cross-reference. The fix was incorporated into the 3.6 backport PR2753 before it was merged.

    This issue is closed, having increased coverage from 46% to 96%. Further work on config and test config should be new issues building on top of this one.

    @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
    3.7 (EOL) end of life topic-IDLE type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants