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

Tkinter spinbox test failures on Tk 8.7 #104856

Closed
Tracked by #104568
chrstphrchvz opened this issue May 24, 2023 · 2 comments
Closed
Tracked by #104568

Tkinter spinbox test failures on Tk 8.7 #104856

chrstphrchvz opened this issue May 24, 2023 · 2 comments
Labels
tests Tests in the Lib/test dir topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@chrstphrchvz
Copy link
Contributor

Tk 8.7 spinboxes allow setting to to an amount less than from, and setting from to an amount greater than to, by swapping the values rather than raising an exception; see https://core.tcl-lang.org/tk/info/841280 . This causes two tests to fail:

======================================================================
FAIL: test_configure_from (test.test_tkinter.test_widgets.SpinboxTest.test_configure_from)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/user/git/cpython/Lib/test/test_tkinter/test_widgets.py", line 490, in test_configure_from
    self.checkInvalidParam(widget, 'from', 200,
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 60, in checkInvalidParam
    with self.assertRaises(tkinter.TclError) as cm:
AssertionError: TclError not raised

======================================================================
FAIL: test_configure_to (test.test_tkinter.test_widgets.SpinboxTest.test_configure_to)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/user/git/cpython/Lib/test/test_tkinter/test_widgets.py", line 501, in test_configure_to
    self.checkInvalidParam(widget, 'to', -200,
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 60, in checkInvalidParam
    with self.assertRaises(tkinter.TclError) as cm:
AssertionError: TclError not raised
@terryjreedy
Copy link
Member

These assertion failures can be fixed by the same mechanism used to fix assertion failures in #104855, and on the same PR.

terryjreedy added a commit to terryjreedy/cpython that referenced this issue May 29, 2023
Where applicable:
* Add '' to the valid options in error messages.
* Test that '' is valid.
* Test that 'to' < 'from' is valid instead of invalid.

This PR also fixes pythongh-104856.
@serhiy-storchaka
Copy link
Member

Fixed by #120824.

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 topic-tkinter type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants