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

Fix the grid geometry manager and add tests for geometry managers #64834

Closed
serhiy-storchaka opened this issue Feb 15, 2014 · 10 comments
Closed
Assignees
Labels
stdlib Python modules in the Lib dir tests Tests in the Lib/test dir topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 20635
Nosy @terryjreedy, @ned-deily, @serhiy-storchaka
Files
  • test_geometry_managers.patch
  • test_geometry_managers_2.patch
  • test_geometry_managers_2-2.7.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/serhiy-storchaka'
    closed_at = <Date 2014-05-23.11:32:33.268>
    created_at = <Date 2014-02-15.11:38:22.501>
    labels = ['tests', 'type-bug', 'expert-tkinter', 'library']
    title = 'Fix the grid geometry manager and add tests for geometry managers'
    updated_at = <Date 2014-05-23.11:32:33.267>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2014-05-23.11:32:33.267>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2014-05-23.11:32:33.268>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)', 'Tests', 'Tkinter']
    creation = <Date 2014-02-15.11:38:22.501>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['34088', '34105', '34800']
    hgrepos = []
    issue_num = 20635
    keywords = ['patch']
    message_count = 10.0
    messages = ['211268', '211303', '211348', '211569', '211628', '211629', '216027', '216028', '216034', '218960']
    nosy_count = 5.0
    nosy_names = ['terry.reedy', 'gpolo', 'ned.deily', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue20635'
    versions = ['Python 2.7', 'Python 3.3', 'Python 3.4']

    @serhiy-storchaka
    Copy link
    Member Author

    Here is a patch which adds tests for Tk geometry managers (pack, place and grid). In additional it fixes the grid_columnconfigure() and grid_rowconfigure() methods which did not worked with wantobject=True (preferable and default mode).

    @serhiy-storchaka serhiy-storchaka added stdlib Python modules in the Lib dir tests Tests in the Lib/test dir topic-tkinter type-bug An unexpected behavior, bug, or error labels Feb 15, 2014
    @serhiy-storchaka serhiy-storchaka changed the title Fix the grid geometry manager and add Fix the grid geometry manager and add tests for geometry managers Feb 15, 2014
    @ned-deily
    Copy link
    Member

    On OS X 10.9 with Cocoa Tk 8.15.0+, Cocoa Tk 8.6, and X11 Tk 8.6:

    ======================================================================
    FAIL: test_place_forget (tkinter.test.test_tkinter.test_geometry_managers.PlaceTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.4/lib/python3.4/tkinter/test/test_tkinter/test_geometry_managers.py", line 440, in test_place_forget
        self.assertTrue(foo.winfo_ismapped())
    AssertionError: 0 is not true

    With OS X Carbon Tk 8.4, the grid_anchor and grid_configure tests fail:

    ======================================================================
    ERROR: test_grid_anchor (tkinter.test.test_tkinter.test_geometry_managers.GridTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.4/lib/python3.4/tkinter/test/test_tkinter/test_geometry_managers.py", line 489, in tearDown
        self.root.grid_anchor('nw')
      File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.4/lib/python3.4/tkinter/__init__.py", line 1321, in grid_anchor
        self.tk.call('grid', 'anchor', self._w, anchor)
    _tkinter.TclError: bad option "anchor": must be bbox, columnconfigure, configure, forget, info, location, propagate, remove, rowconfigure, size, or slaves

    ======================================================================
    ERROR: test_grid_columnconfigure (tkinter.test.test_tkinter.test_geometry_managers.GridTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.4/lib/python3.4/tkinter/test/test_tkinter/test_geometry_managers.py", line 617, in test_grid_columnconfigure
        self.root.grid_columnconfigure('all', weight=3)
      File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.4/lib/python3.4/tkinter/__init__.py", line 1389, in grid_columnconfigure
        return self._grid_configure('columnconfigure', index, cnf, kw)
      File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.4/lib/python3.4/tkinter/__init__.py", line 1379, in _grid_configure
        + options)
    _tkinter.TclError: expected integer but got "all"

    ... along with:

    ======================================================================
    ERROR: test_grid_rowconfigure (tkinter.test.test_tkinter.test_geometry_managers.GridTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.4/lib/python3.4/tkinter/test/test_tkinter/test_geometry_managers.py", line 671, in test_grid_rowconfigure
        self.root.grid_rowconfigure('all', weight=3)
      File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.4/lib/python3.4/tkinter/__init__.py", line 1416, in grid_rowconfigure
        return self._grid_configure('rowconfigure', index, cnf, kw)
      File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.4/lib/python3.4/tkinter/__init__.py", line 1379, in _grid_configure
        + options)
    _tkinter.TclError: expected integer but got "all"

    ======================================================================
    FAIL: test_place_configure_in (tkinter.test.test_tkinter.test_geometry_managers.PlaceTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.4/lib/python3.4/tkinter/test/test_tkinter/test_geometry_managers.py", line 294, in test_place_configure_in
        self.assertEqual(f2.winfo_manager(), '')
    AssertionError: 'place' != ''
    - place
    +

    ======================================================================
    FAIL: test_place_forget (tkinter.test.test_tkinter.test_geometry_managers.PlaceTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.4/lib/python3.4/tkinter/test/test_tkinter/test_geometry_managers.py", line 440, in test_place_forget
        self.assertTrue(foo.winfo_ismapped())
    AssertionError: 0 is not true

    ======================================================================
    FAIL: test_grid_configure_row (tkinter.test.test_tkinter.test_geometry_managers.GridTest)
    ----------------------------------------------------------------------
    _tkinter.TclError: bad grid value "-1": must be a non-negative integer

    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.9.framework/Versions/3.4/lib/python3.4/tkinter/test/test_tkinter/test_geometry_managers.py", line 583, in test_grid_configure_row
        b.grid_configure(row=-1)
    AssertionError: "bad row value "-1": must be a non-negative integer" does not match "bad grid value "-1": must be a non-negative integer"

    Ran 597 tests in 4.270s

    FAILED (failures=4, errors=32, skipped=16)

    @serhiy-storchaka
    Copy link
    Member Author

    My fault. I tested the patch with 8.5 and 8.6, but was too lazy to check it with 8.4. Here is updated patch with workarounded 8.4 peculiarities.

    I'm not sure about test_place_forget(). I have removed the check, hope this will help.

    Thank you Ned.

    @ned-deily
    Copy link
    Member

    With test_geometry_managers_2.patch, test_tk now passes with all of the previously tested OS X Tk versions.

    @serhiy-storchaka
    Copy link
    Member Author

    Unfortunately new tests emit on 3.3 and 2.7 same warnings as in bpo-20567. So I have committed only the fix, without tests.

    @serhiy-storchaka
    Copy link
    Member Author

    Changesets 857ddbaff14e (2.7), 6227b0ecb5fb (3.3) and b6df5f8f86d3 (default).

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Apr 13, 2014

    New changeset e8c184d8407d by Serhiy Storchaka in branch '3.4':
    Issue bpo-20635: Added tests for Tk geometry managers.
    http://hg.python.org/cpython/rev/e8c184d8407d

    New changeset e8acef4f8567 by Serhiy Storchaka in branch 'default':
    Issue bpo-20635: Added tests for Tk geometry managers.
    http://hg.python.org/cpython/rev/e8acef4f8567

    @serhiy-storchaka
    Copy link
    Member Author

    Here is a patch for 2.7.

    @serhiy-storchaka serhiy-storchaka self-assigned this Apr 13, 2014
    @ned-deily
    Copy link
    Member

    test_tk with test_geometry_managers_2-2.7.patch applied passed on OS X 10.9 linked with Carbon Tk 8.4.20, Cocoa 8.5.15, Cocoa 8.6.1, and X11 8.6.1.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 23, 2014

    New changeset 9ab1225b6cc5 by Serhiy Storchaka in branch '2.7':
    Issue bpo-20635: Added tests for Tk geometry managers.
    http://hg.python.org/cpython/rev/9ab1225b6cc5

    @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 tests Tests in the Lib/test dir topic-tkinter type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants