This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add tkinter basic options tests
Type: enhancement Stage: resolved
Components: Tests, Tkinter Versions: Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: gpolo, ned.deily, python-dev, serhiy.storchaka, terry.reedy, vajrasky, zach.ware
Priority: critical Keywords: patch

Created on 2013-09-24 20:30 by serhiy.storchaka, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
tkinter_options_tests.patch serhiy.storchaka, 2013-09-24 20:30 review
tkinter_options_tests_2.patch serhiy.storchaka, 2013-10-26 20:32 review
tkinter_options_tests_3.patch serhiy.storchaka, 2013-10-31 21:34 review
pixels_round.diff serhiy.storchaka, 2013-11-03 16:32 review
Messages (34)
msg198366 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-09-24 20:30
The proposed patch adds tests for all options of all widgets. They test that widgets support all documented options, accepts valid values in different formats, reject invalid values, and return values in expected format. This would be helpful for regression testing.

The patch tested with Tcl/Tk 8.5 and 8.6 on Linux. All new tests are compatible with wantobjects=1 and wantobjects=0.

It will be good to test it with Tcl/Tk 8.4 (or even 8.3) and on Windows.
msg199862 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-10-14 10:51
If there are no objections I'm going to commit this.
msg200018 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-10-15 21:14
With Aqua Cocoa Tcl/Tk 8.5.14 or 8.6.0 (using ActiveState's 8.5.14 or 8.6.0) on OS X 10.8.5, running test_ttk_guionly:

======================================================================
ERROR: test_class (tkinter.test.test_ttk.test_widgets.ScrollbarTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/test_ttk/test_widgets.py", line 22, in test_class
    self.assertEqual(widget['class'], '')
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/__init__.py", line 1267, in cget
    return self.tk.call(self._w, 'cget', '-' + key)
_tkinter.TclError: unknown option "-class"

======================================================================
ERROR: test_style (tkinter.test.test_ttk.test_widgets.ScrollbarTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/test_ttk/test_widgets.py", line 44, in test_style
    self.assertEqual(widget['style'], '')
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/__init__.py", line 1267, in cget
    return self.tk.call(self._w, 'cget', '-' + key)
_tkinter.TclError: unknown option "-style"

======================================================================
FAIL: test_orient (tkinter.test.test_ttk.test_widgets.ScrollbarTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 426, in test_orient
    self.checkEnumParam(widget, 'orient', 'horizontal', 'vertical')
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 244, in checkEnumParam
    errmsg='ambiguous' + errmsg2)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 174, in checkInvalidParam
    widget[name] = value
AssertionError: TclError not raised

----------------------------------------------------------------------
Ran 233 tests in 2.823s

FAILED (failures=1, errors=2, skipped=1)
test test_ttk_guionly failed
1 test failed:
    test_ttk_guionly

---------------

With Aqua Carbon Tcl/Tk 8.4.19 (using ActiveState's 8.4.19) on OS X 10.8.5, running test_ttk_guionly (in 32-bit mode):

=====================================================================
ERROR: test_class (tkinter.test.test_ttk.test_widgets.ScrollbarTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/test_ttk/test_widgets.py", line 22, in test_class
    self.assertEqual(widget['class'], '')
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/__init__.py", line 1267, in cget
    return self.tk.call(self._w, 'cget', '-' + key)
_tkinter.TclError: unknown option "-class"

======================================================================
ERROR: test_style (tkinter.test.test_ttk.test_widgets.ScrollbarTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/test_ttk/test_widgets.py", line 44, in test_style
    self.assertEqual(widget['style'], '')
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/__init__.py", line 1267, in cget
    return self.tk.call(self._w, 'cget', '-' + key)
_tkinter.TclError: unknown option "-style"

======================================================================
FAIL: test_values (tkinter.test.test_ttk.test_widgets.ComboboxTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/test_ttk/test_widgets.py", line 351, in test_values
    self.assertEqual(self.combo['values'], '')
AssertionError: () != ''

======================================================================
FAIL: test_borderwidth (tkinter.test.test_ttk.test_widgets.FrameTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 336, in test_borderwidth
    0, 1.3, 2.6, 6, -2, '10p')
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 260, in checkPixelsParam
    conv=conv, **kwargs)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 161, in checkParam
    self.assertEqual2(widget[name], expected, eq=eq)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 145, in assertEqual2
    self.assertEqual(actual, expected, msg)
AssertionError: <pixel object: '0'> != 0

======================================================================
FAIL: test_height (tkinter.test.test_ttk.test_widgets.FrameTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 556, in test_height
    self.checkPixelsParam(widget, 'height', 100, 101.2, 102.6, -100, 0, '3c')
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 260, in checkPixelsParam
    conv=conv, **kwargs)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 161, in checkParam
    self.assertEqual2(widget[name], expected, eq=eq)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 145, in assertEqual2
    self.assertEqual(actual, expected, msg)
AssertionError: <pixel object: '100'> != 100

======================================================================
FAIL: test_width (tkinter.test.test_ttk.test_widgets.FrameTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 560, in test_width
    self.checkPixelsParam(widget, 'width', 402, 403.4, 404.6, -402, 0, '5i')
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 260, in checkPixelsParam
    conv=conv, **kwargs)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 161, in checkParam
    self.assertEqual2(widget[name], expected, eq=eq)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 145, in assertEqual2
    self.assertEqual(actual, expected, msg)
AssertionError: <pixel object: '402'> != 402

======================================================================
FAIL: test_borderwidth (tkinter.test.test_ttk.test_widgets.LabelFrameTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 336, in test_borderwidth
    0, 1.3, 2.6, 6, -2, '10p')
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 260, in checkPixelsParam
    conv=conv, **kwargs)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 161, in checkParam
    self.assertEqual2(widget[name], expected, eq=eq)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 145, in assertEqual2
    self.assertEqual(actual, expected, msg)
AssertionError: <pixel object: '0'> != 0

======================================================================
FAIL: test_height (tkinter.test.test_ttk.test_widgets.LabelFrameTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 556, in test_height
    self.checkPixelsParam(widget, 'height', 100, 101.2, 102.6, -100, 0, '3c')
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 260, in checkPixelsParam
    conv=conv, **kwargs)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 161, in checkParam
    self.assertEqual2(widget[name], expected, eq=eq)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 145, in assertEqual2
    self.assertEqual(actual, expected, msg)
AssertionError: <pixel object: '100'> != 100

======================================================================
FAIL: test_width (tkinter.test.test_ttk.test_widgets.LabelFrameTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 560, in test_width
    self.checkPixelsParam(widget, 'width', 402, 403.4, 404.6, -402, 0, '5i')
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 260, in checkPixelsParam
    conv=conv, **kwargs)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 161, in checkParam
    self.assertEqual2(widget[name], expected, eq=eq)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 145, in assertEqual2
    self.assertEqual(actual, expected, msg)
AssertionError: <pixel object: '402'> != 402

======================================================================
FAIL: test_wraplength (tkinter.test.test_ttk.test_widgets.LabelTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 493, in test_wraplength
    self.checkParams(widget, 'wraplength', 100)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 186, in checkParams
    self.checkParam(widget, name, value, **kwargs)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 161, in checkParam
    self.assertEqual2(widget[name], expected, eq=eq)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 145, in assertEqual2
    self.assertEqual(actual, expected, msg)
AssertionError: <pixel object: '100'> != 100

======================================================================
FAIL: test_length (tkinter.test.test_ttk.test_widgets.ProgressbarTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/test_ttk/test_widgets.py", line 876, in test_length
    self.checkPixelsParam(widget, 'length', 100.1, 56.7, '2i')
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 260, in checkPixelsParam
    conv=conv, **kwargs)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 161, in checkParam
    self.assertEqual2(widget[name], expected, eq=eq)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 145, in assertEqual2
    self.assertEqual(actual, expected, msg)
AssertionError: <pixel object: '100.1'> != 100.1

======================================================================
FAIL: test_length (tkinter.test.test_ttk.test_widgets.ScaleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/test_ttk/test_widgets.py", line 787, in test_length
    self.checkPixelsParam(widget, 'length', 130, 131.2, 135.6, '5i')
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 260, in checkPixelsParam
    conv=conv, **kwargs)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 161, in checkParam
    self.assertEqual2(widget[name], expected, eq=eq)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 145, in assertEqual2
    self.assertEqual(actual, expected, msg)
AssertionError: <pixel object: '130'> != 130

======================================================================
FAIL: test_orient (tkinter.test.test_ttk.test_widgets.ScrollbarTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 426, in test_orient
    self.checkEnumParam(widget, 'orient', 'horizontal', 'vertical')
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 244, in checkEnumParam
    errmsg='ambiguous' + errmsg2)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 174, in checkInvalidParam
    widget[name] = value
AssertionError: TclError not raised

======================================================================
FAIL: test_height (tkinter.test.test_ttk.test_widgets.TreeviewTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 556, in test_height
    self.checkPixelsParam(widget, 'height', 100, 101.2, 102.6, -100, 0, '3c')
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 260, in checkPixelsParam
    conv=conv, **kwargs)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 161, in checkParam
    self.assertEqual2(widget[name], expected, eq=eq)
  File "/py/dev/3x/root/fwd/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/support.py", line 145, in assertEqual2
    self.assertEqual(actual, expected, msg)
AssertionError: <pixel object: '101.2'> != 101.2

----------------------------------------------------------------------
Ran 233 tests in 3.203s

FAILED (failures=12, errors=2, skipped=1)
test test_ttk_guionly failed
msg200024 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-10-15 21:42
Thank you Ned.
msg201394 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-10-26 20:32
Updated patch fixes issues for Tk 8.4 and skipped ttk.Scrollbar test on MacOSX.

I have increased the priority because many Tkinter issues will benefit from these tests.
msg201850 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-10-31 21:34
Updated patch addresses Ezio's comments.
msg201965 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-11-02 08:48
New changeset 92e268f2719e by Serhiy Storchaka in branch '3.3':
Issue #19085: Added basic tests for all tkinter widget options.
http://hg.python.org/cpython/rev/92e268f2719e

New changeset ab7c2c1d349c by Serhiy Storchaka in branch 'default':
Issue #19085: Added basic tests for all tkinter widget options.
http://hg.python.org/cpython/rev/ab7c2c1d349c

New changeset ced345326151 by Serhiy Storchaka in branch '2.7':
Issue #19085: Added basic tests for all tkinter widget options.
http://hg.python.org/cpython/rev/ced345326151
msg201973 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-11-02 14:41
New changeset cee56ef59a6a by Serhiy Storchaka in branch 'default':
Issue #19085. Try to fix tkinter tests on Windows.
http://hg.python.org/cpython/rev/cee56ef59a6a
msg201977 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-11-02 15:28
New changeset 278d15021d9a by Serhiy Storchaka in branch '2.7':
Issue #19085: Fix Tkinter tests with Tcl/Tk 8.4.
http://hg.python.org/cpython/rev/278d15021d9a
msg201979 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-11-02 16:54
New changeset f25679db52fb by Serhiy Storchaka in branch '3.3':
Issue #19085: Fixed some Tkinter tests on Windows.
http://hg.python.org/cpython/rev/f25679db52fb

New changeset 4a2afda8f187 by Serhiy Storchaka in branch '2.7':
Issue #19085: Fixed some Tkinter tests on Windows.
http://hg.python.org/cpython/rev/4a2afda8f187
msg202006 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-11-03 09:14
With Cocoa Tk 8.5.15 or Cocoa Tk 8.6.1 on OS X 10.8.5, test_widgets.ButtonTest crashes Tk:

test_image (tkinter.test.test_tkinter.test_widgets.ButtonTest) ... 2013-11-03 01:52:53.498 pytest_10.8[82465:f07] *** Assertion failure in -[NSBitmapImageRep initWithCGImage:], /SourceCache/AppKit/AppKit-1187.40/AppKit.subproj/NSBitmapImageRep.m:1242
2013-11-03 01:52:53.499 pytest_10.8[82465:f07] An uncaught exception was raised
2013-11-03 01:52:53.499 pytest_10.8[82465:f07] Invalid parameter not satisfying: cgImage != NULL
2013-11-03 01:52:53.502 pytest_10.8[82465:f07] (
	0   CoreFoundation                      0x965eae8b __raiseError + 219
	1   libobjc.A.dylib                     0x956d152e objc_exception_throw + 230
	2   CoreFoundation                      0x9654a698 +[NSException raise:format:arguments:] + 136
	3   Foundation                          0x966a5364 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
	4   AppKit                              0x98a34525 -[NSBitmapImageRep initWithCGImage:] + 145
	5   Tk                                  0x00725a48 CreateNSImageWithPixmap + 151
	6   Tk                                  0x00725b1c TkMacOSXGetNSImageWithTkImage + 149
	7   Tk                                  0x0071eb2f TkpComputeButtonGeometry + 2550
	8   Tk                                  0x0069849d TkButtonWorldChanged + 470
	9   Tk                                  0x00698e99 ConfigureButton + 1981
	10  Tk                                  0x0069980f ButtonWidgetObjCmd + 440
	11  Tcl                                 0x00579c2f TclEvalObjvInternal + 770
	12  Tcl                                 0x0057ac1a Tcl_EvalObjv + 72
	13  _tkinter.so                         0x0055db81 Tkapp_Call + 673
        [...]


With Carbon Tk 8.4.20 on OS X 10.8.5, two test_insertborderwidth failures:

======================================================================
FAIL: test_insertborderwidth (tkinter.test.test_tkinter.test_widgets.EntryTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd32/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/test_tkinter/test_widgets.py", line 327, in test_insertborderwidth
    self.checkPixelsParam(widget, 'insertborderwidth', 0, 1.3, -2)
  File "/py/dev/3x/root/fwd32/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/widget_tests.py", line 158, in checkPixelsParam
    conv=conv1, **kwargs)
  File "/py/dev/3x/root/fwd32/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/widget_tests.py", line 48, in checkParam
    self.assertEqual2(widget[name], expected, eq=eq)
  File "/py/dev/3x/root/fwd32/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/widget_tests.py", line 32, in assertEqual2
    self.assertEqual(actual, expected, msg)
AssertionError: 0 != 1

======================================================================
FAIL: test_insertborderwidth (tkinter.test.test_tkinter.test_widgets.SpinboxTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/py/dev/3x/root/fwd32/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/test_tkinter/test_widgets.py", line 327, in test_insertborderwidth
    self.checkPixelsParam(widget, 'insertborderwidth', 0, 1.3, -2)
  File "/py/dev/3x/root/fwd32/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/widget_tests.py", line 158, in checkPixelsParam
    conv=conv1, **kwargs)
  File "/py/dev/3x/root/fwd32/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/widget_tests.py", line 48, in checkParam
    self.assertEqual2(widget[name], expected, eq=eq)
  File "/py/dev/3x/root/fwd32/Library/Frameworks/pytest_10.8.framework/Versions/3.4/lib/python3.4/tkinter/test/widget_tests.py", line 32, in assertEqual2
    self.assertEqual(actual, expected, msg)
AssertionError: 0 != 1

----------------------------------------------------------------------
Ran 536 tests in 1.149s

FAILED (failures=2, skipped=10)
msg202008 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-11-03 10:07
Yes, I know. Here is a list of broken buildbots:

http://buildbot.python.org/all/builders/x86%20FreeBSD%206.4%203.x
http://buildbot.python.org/all/builders/x86%20FreeBSD%207.2%203.x
http://buildbot.python.org/all/builders/x86%20FreeBSD%206.4%203.3
http://buildbot.python.org/all/builders/x86%20Tiger%203.3
http://buildbot.python.org/all/builders/x86%20Windows7%202.7
http://buildbot.python.org/all/builders/x86%20XP-4%202.7
http://buildbot.python.org/all/builders/x86%20FreeBSD%206.4%202.7
http://buildbot.python.org/all/builders/x86%20FreeBSD%207.2%202.7

On Tiger only two tests failed, on other buildbots multiple tests failed and symptoms look as differences between 8.5 and 8.4 or 8.5 (Tk version is wrongly detected?). I'm working on this.
msg202023 - (view) Author: Vajrasky Kok (vajrasky) * Date: 2013-11-03 13:07
Serhiy,

In Python3.4, Windows Vista 32 bit, Release Mode, Tcl/Tk 8.5.15, I got a lot of errors. However, if I set _conv_pixels to round in Lib/tkinter/test/widget_tests.py, everything works fine.

In Python 3.4, Fedora 18, Debug Mode, Tcl/Tk 8.5.13, I got a lot of errors. However, if I set _conv_pixels to round in Lib/tkinter/test/widget_tests.py, I got two errors only.

======================================================================
FAIL: test_insertwidth (__main__.EntryTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/tkinter/test/test_tkinter/test_widgets.py", line 335, in test_insertwidth
    self.checkParam(widget, 'insertwidth', 0.9, expected=2)
  File "/home/sky/Code/python/programming_language/cpython/Lib/tkinter/test/widget_tests.py", line 49, in checkParam
    self.assertEqual2(widget[name], expected, eq=eq)
  File "/home/sky/Code/python/programming_language/cpython/Lib/tkinter/test/widget_tests.py", line 33, in assertEqual2
    self.assertEqual(actual, expected, msg)
AssertionError: 1 != 2

Other error is same.

Hope that helps!
msg202033 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-11-03 16:26
New changeset a34889a30d52 by Serhiy Storchaka in branch '2.7':
Issue #19085: Fixed pixels rounding for last Tk patchlevels.
http://hg.python.org/cpython/rev/a34889a30d52

New changeset dfdf47a9aad4 by Serhiy Storchaka in branch '3.3':
Issue #19085: Fixed pixels rounding for last Tk patchlevels.
http://hg.python.org/cpython/rev/dfdf47a9aad4

New changeset e7be7aceab77 by Serhiy Storchaka in branch 'default':
Issue #19085: Fixed pixels rounding for last Tk patchlevels.
http://hg.python.org/cpython/rev/e7be7aceab77
msg202036 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-11-03 16:32
Thanks Vajrasky. Now I see that this is a bug in Tk 8.5 which was fixed in 8.5.12. We should use round() to conform with last Tk patchlevels. However this breaks tests on Ubuntu 12.04 LTS which uses 8.5.11.

Here is a patch which adds workaround for this bug.
msg202163 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-11-04 20:12
New changeset c3fa22d04fb2 by Serhiy Storchaka in branch '2.7':
Issue #19085: Fix Tkinter tests on Tk 8.5 with patchlevel < 8.5.12.
http://hg.python.org/cpython/rev/c3fa22d04fb2

New changeset 583347b79aa0 by Serhiy Storchaka in branch '3.3':
Issue #19085: Fix Tkinter tests on Tk 8.5 with patchlevel < 8.5.12.
http://hg.python.org/cpython/rev/583347b79aa0

New changeset fe5a829bd645 by Serhiy Storchaka in branch 'default':
Issue #19085: Fix Tkinter tests on Tk 8.5 with patchlevel < 8.5.12.
http://hg.python.org/cpython/rev/fe5a829bd645
msg202171 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-11-04 21:07
New changeset fe7aaf14b129 by Serhiy Storchaka in branch '2.7':
Issue #19085: Fix running test_ttk_textonly on displayless host.
http://hg.python.org/cpython/rev/fe7aaf14b129

New changeset 47d3714dcb33 by Serhiy Storchaka in branch '3.3':
Issue #19085: Fix running test_ttk_textonly on displayless host.
http://hg.python.org/cpython/rev/47d3714dcb33

New changeset 713cc4908a96 by Serhiy Storchaka in branch 'default':
Issue #19085: Fix running test_ttk_textonly on displayless host.
http://hg.python.org/cpython/rev/713cc4908a96
msg202228 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2013-11-05 17:58
Looks like the last commit broke 8.5.15 on Windows; in particular, on line 25 of widget_tests.py, int_round doesn't exist.  Replacing 'int_round' with 'round' allows most tests to pass, but I still get these two failures:

======================================================================
FAIL: test_insertwidth (tkinter.test.test_tkinter.test_widgets.EntryTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "P:\Projects\OSS\Python\cpython\lib\tkinter\test\test_tkinter\test_widget
s.py", line 336, in test_insertwidth
    self.checkParam(widget, 'insertwidth', 0.9, expected=2)
  File "P:\Projects\OSS\Python\cpython\lib\tkinter\test\widget_tests.py", line 6
6, in checkParam
    self.assertEqual2(widget[name], expected, eq=eq)
  File "P:\Projects\OSS\Python\cpython\lib\tkinter\test\widget_tests.py", line 5
0, in assertEqual2
    self.assertEqual(actual, expected, msg)
AssertionError: 1 != 2

======================================================================
FAIL: test_insertwidth (tkinter.test.test_tkinter.test_widgets.SpinboxTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "P:\Projects\OSS\Python\cpython\lib\tkinter\test\test_tkinter\test_widget
s.py", line 336, in test_insertwidth
    self.checkParam(widget, 'insertwidth', 0.9, expected=2)
  File "P:\Projects\OSS\Python\cpython\lib\tkinter\test\widget_tests.py", line 6
6, in checkParam
    self.assertEqual2(widget[name], expected, eq=eq)
  File "P:\Projects\OSS\Python\cpython\lib\tkinter\test\widget_tests.py", line 5
0, in assertEqual2
    self.assertEqual(actual, expected, msg)
AssertionError: 1 != 2
msg202230 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-11-05 18:18
New changeset d5d0356ba5ac by Serhiy Storchaka in branch '3.3':
Fix typo in tkinter tests (issue #19085).
http://hg.python.org/cpython/rev/d5d0356ba5ac

New changeset fc4ef17c7db8 by Serhiy Storchaka in branch 'default':
Fix typo in tkinter tests (issue #19085).
http://hg.python.org/cpython/rev/fc4ef17c7db8
msg202231 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-11-05 18:20
Thank you Zachary.
msg202232 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-11-05 19:12
New changeset eb126f976fa2 by Serhiy Storchaka in branch '2.7':
Fix test_insertwidth Tkinter tests on Tk 8.5 with patchlevel >= 8.5.12 (issue #19085).
http://hg.python.org/cpython/rev/eb126f976fa2

New changeset 21fbe3ec90dc by Serhiy Storchaka in branch '3.3':
Fix test_insertwidth Tkinter tests on Tk 8.5 with patchlevel >= 8.5.12 (issue #19085).
http://hg.python.org/cpython/rev/21fbe3ec90dc

New changeset ce08158e3f6c by Serhiy Storchaka in branch 'default':
Fix test_insertwidth Tkinter tests on Tk 8.5 with patchlevel >= 8.5.12 (issue #19085).
http://hg.python.org/cpython/rev/ce08158e3f6c
msg202233 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2013-11-05 19:32
Working from ce08158e3f6c with 8.5.15 on Windows, I get the same failures with a different AssertionError:

======================================================================
FAIL: test_insertwidth (tkinter.test.test_tkinter.test_widgets.EntryTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "P:\Projects\OSS\Python\cpython\lib\tkinter\test\test_tkinter\test_widget
s.py", line 340, in test_insertwidth
    self.checkParam(widget, 'insertwidth', 0.9)
  File "P:\Projects\OSS\Python\cpython\lib\tkinter\test\widget_tests.py", line 6
6, in checkParam
    self.assertEqual2(widget[name], expected, eq=eq)
  File "P:\Projects\OSS\Python\cpython\lib\tkinter\test\widget_tests.py", line 5
0, in assertEqual2
    self.assertEqual(actual, expected, msg)
AssertionError: 1 != 0.9

======================================================================
FAIL: test_insertwidth (tkinter.test.test_tkinter.test_widgets.SpinboxTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "P:\Projects\OSS\Python\cpython\lib\tkinter\test\test_tkinter\test_widget
s.py", line 340, in test_insertwidth
    self.checkParam(widget, 'insertwidth', 0.9)
  File "P:\Projects\OSS\Python\cpython\lib\tkinter\test\widget_tests.py", line 6
6, in checkParam
    self.assertEqual2(widget[name], expected, eq=eq)
  File "P:\Projects\OSS\Python\cpython\lib\tkinter\test\widget_tests.py", line 5
0, in assertEqual2
    self.assertEqual(actual, expected, msg)
AssertionError: 1 != 0.9

By the way, thank you for all the work you're doing on this, Serhiy!
msg202235 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2013-11-05 19:44
FTR, both 8.5.11 and 8.6.1 pass all tests on Windows from ce08158e3f6c (with unrelated modifications required to build and use 8.6.1).
msg202236 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-11-05 20:04
New changeset c97600bdd726 by Serhiy Storchaka in branch '2.7':
Revert wrong change in previous commit (issue #19085).
http://hg.python.org/cpython/rev/c97600bdd726

New changeset bec6df56c053 by Serhiy Storchaka in branch '3.3':
Revert wrong change in previous commit (issue #19085).
http://hg.python.org/cpython/rev/bec6df56c053

New changeset 545feebd58fb by Serhiy Storchaka in branch 'default':
Revert wrong change in previous commit (issue #19085).
http://hg.python.org/cpython/rev/545feebd58fb
msg202237 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-11-05 20:04
My fault. I missed that here is simple checkParam() instead of checkPixelsParam(). Thank you Zachary.
msg202493 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-11-09 19:17
New changeset be8f9beca8aa by Serhiy Storchaka in branch '2.7':
Fix Tkinter tests on Tk 8.5 with patchlevel < 8.5.11 (issue #19085).
http://hg.python.org/cpython/rev/be8f9beca8aa

New changeset 204e66190dbb by Serhiy Storchaka in branch '3.3':
Fix Tkinter tests on Tk 8.5 with patchlevel < 8.5.11 (issue #19085).
http://hg.python.org/cpython/rev/204e66190dbb

New changeset 2834e410d1ae by Serhiy Storchaka in branch 'default':
Fix Tkinter tests on Tk 8.5 with patchlevel < 8.5.11 (issue #19085).
http://hg.python.org/cpython/rev/2834e410d1ae
msg203957 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-11-23 02:24
test_widgets.ButtonTest is still causing a Cocoa Tk 8.5/8.6 crash which also crashes Python while running the test suite.  The test should be fixed or disabled.
msg203974 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-11-23 07:19
Crashes? It should be separate issue, no one Tkinter operation shouldn't crash Python.

Fill free to disable this tests on MacOSX (or better on more specific environment) if they prevent the test suite from running.
msg203975 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-11-23 07:22
See msg202006 above.
msg204004 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-11-23 13:24
> test_widgets.ButtonTest is still causing a Cocoa Tk 8.5/8.6 crash which also
> crashes Python while running the test suite.  The test should be fixed or
> disabled.

Opened issue19733 for this.
msg204286 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-11-25 00:07
I've opened Issue19761 to document the current state of test failures for 3.4.0b1 on OS X with the native Tk 8.5 and 8.4.
msg212387 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2014-02-27 21:09
What's the status here? Appears to be fixed?
msg212391 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-02-27 22:14
All of the failures I reported are now fixed so I think this issue can be closed.
msg212472 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-02-28 20:39
Thank you Net, Vajrasky and Zachary for your help for testing.
History
Date User Action Args
2022-04-11 14:57:51adminsetgithub: 63285
2014-02-28 20:39:16serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: + msg212472

stage: patch review -> resolved
2014-02-27 22:14:28ned.deilysetmessages: + msg212391
2014-02-27 21:09:09zach.waresetmessages: + msg212387
2013-11-25 00:07:10ned.deilysetmessages: + msg204286
2013-11-23 13:24:40serhiy.storchakasetmessages: + msg204004
2013-11-23 07:22:13ned.deilysetmessages: + msg203975
2013-11-23 07:19:54serhiy.storchakasetmessages: + msg203974
2013-11-23 02:24:11ned.deilysetmessages: + msg203957
2013-11-09 19:18:00python-devsetmessages: + msg202493
2013-11-05 20:04:55serhiy.storchakasetmessages: + msg202237
2013-11-05 20:04:33python-devsetmessages: + msg202236
2013-11-05 19:44:50zach.waresetmessages: + msg202235
2013-11-05 19:32:56zach.waresetmessages: + msg202233
2013-11-05 19:12:40python-devsetmessages: + msg202232
2013-11-05 18:20:28serhiy.storchakasetmessages: + msg202231
2013-11-05 18:18:57python-devsetmessages: + msg202230
2013-11-05 17:58:59zach.waresetnosy: + zach.ware
messages: + msg202228
2013-11-04 21:07:25python-devsetmessages: + msg202171
2013-11-04 20:12:52python-devsetmessages: + msg202163
2013-11-03 16:32:51serhiy.storchakasetfiles: + pixels_round.diff

messages: + msg202036
2013-11-03 16:26:28python-devsetmessages: + msg202033
2013-11-03 13:35:01serhiy.storchakaunlinkissue6157 dependencies
2013-11-03 13:07:01vajraskysetnosy: + vajrasky
messages: + msg202023
2013-11-03 10:07:00serhiy.storchakasetmessages: + msg202008
2013-11-03 09:14:56ned.deilysetpriority: high -> critical

messages: + msg202006
2013-11-02 16:54:16python-devsetmessages: + msg201979
2013-11-02 15:28:23python-devsetmessages: + msg201977
2013-11-02 14:41:45python-devsetmessages: + msg201973
2013-11-02 08:48:34python-devsetnosy: + python-dev
messages: + msg201965
2013-10-31 21:34:52serhiy.storchakasetfiles: + tkinter_options_tests_3.patch

messages: + msg201850
2013-10-31 18:56:52serhiy.storchakalinkissue6157 dependencies
2013-10-26 20:33:04serhiy.storchakasetfiles: + tkinter_options_tests_2.patch
2013-10-26 20:32:26serhiy.storchakasetpriority: normal -> high

messages: + msg201394
2013-10-15 21:42:44serhiy.storchakasetmessages: + msg200024
2013-10-15 21:14:38ned.deilysetmessages: + msg200018
2013-10-14 10:51:28serhiy.storchakasetassignee: serhiy.storchaka
messages: + msg199862
2013-09-24 23:50:43ned.deilysetnosy: + ned.deily
2013-09-24 20:30:31serhiy.storchakacreate