Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4a21726f
Commit
4a21726f
authored
Nov 02, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #19085: Fix Tkinter tests with Tcl/Tk 8.4.
parent
090b6b1b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
14 deletions
+15
-14
Lib/lib-tk/test/test_tkinter/test_widgets.py
Lib/lib-tk/test/test_tkinter/test_widgets.py
+6
-6
Lib/lib-tk/test/test_ttk/test_widgets.py
Lib/lib-tk/test/test_ttk/test_widgets.py
+7
-7
Lib/lib-tk/test/widget_tests.py
Lib/lib-tk/test/widget_tests.py
+2
-1
No files found.
Lib/lib-tk/test/test_tkinter/test_widgets.py
View file @
4a21726f
...
@@ -4,7 +4,7 @@ import os
...
@@ -4,7 +4,7 @@ import os
from
test.test_support
import
requires
,
run_unittest
from
test.test_support
import
requires
,
run_unittest
from
test_ttk.support
import
tcl_version
,
requires_tcl
,
widget_eq
from
test_ttk.support
import
tcl_version
,
requires_tcl
,
widget_eq
from
widget_tests
import
(
add_standard_options
,
noconv
,
int_round
,
from
widget_tests
import
(
add_standard_options
,
noconv
,
noconv_meth
,
int_round
,
AbstractWidgetTest
,
StandardOptionsTests
,
AbstractWidgetTest
,
StandardOptionsTests
,
IntegerSizeTests
,
PixelSizeTests
)
IntegerSizeTests
,
PixelSizeTests
)
...
@@ -12,7 +12,7 @@ requires('gui')
...
@@ -12,7 +12,7 @@ requires('gui')
class
AbstractToplevelTest
(
AbstractWidgetTest
,
PixelSizeTests
):
class
AbstractToplevelTest
(
AbstractWidgetTest
,
PixelSizeTests
):
_conv_pad_pixels
=
noconv
_conv_pad_pixels
=
noconv
_meth
def
test_class
(
self
):
def
test_class
(
self
):
widget
=
self
.
create
()
widget
=
self
.
create
()
...
@@ -130,7 +130,7 @@ class LabelFrameTest(AbstractToplevelTest, unittest.TestCase):
...
@@ -130,7 +130,7 @@ class LabelFrameTest(AbstractToplevelTest, unittest.TestCase):
class
AbstractLabelTest
(
AbstractWidgetTest
,
IntegerSizeTests
):
class
AbstractLabelTest
(
AbstractWidgetTest
,
IntegerSizeTests
):
_conv_pixels
=
noconv
_conv_pixels
=
noconv
_meth
def
test_highlightthickness
(
self
):
def
test_highlightthickness
(
self
):
widget
=
self
.
create
()
widget
=
self
.
create
()
...
@@ -240,7 +240,7 @@ class MenubuttonTest(AbstractLabelTest, unittest.TestCase):
...
@@ -240,7 +240,7 @@ class MenubuttonTest(AbstractLabelTest, unittest.TestCase):
'takefocus'
,
'text'
,
'textvariable'
,
'takefocus'
,
'text'
,
'textvariable'
,
'underline'
,
'width'
,
'wraplength'
,
'underline'
,
'width'
,
'wraplength'
,
)
)
_conv_pixels
=
AbstractWidgetTest
.
_conv_pixels
_conv_pixels
=
staticmethod
(
AbstractWidgetTest
.
_conv_pixels
)
def
_create
(
self
,
**
kwargs
):
def
_create
(
self
,
**
kwargs
):
return
Tkinter
.
Menubutton
(
self
.
root
,
**
kwargs
)
return
Tkinter
.
Menubutton
(
self
.
root
,
**
kwargs
)
...
@@ -858,7 +858,7 @@ class MenuTest(AbstractWidgetTest, unittest.TestCase):
...
@@ -858,7 +858,7 @@ class MenuTest(AbstractWidgetTest, unittest.TestCase):
'postcommand'
,
'relief'
,
'selectcolor'
,
'takefocus'
,
'postcommand'
,
'relief'
,
'selectcolor'
,
'takefocus'
,
'tearoff'
,
'tearoffcommand'
,
'title'
,
'type'
,
'tearoff'
,
'tearoffcommand'
,
'title'
,
'type'
,
)
)
_conv_pixels
=
noconv
_conv_pixels
=
noconv
_meth
def
_create
(
self
,
**
kwargs
):
def
_create
(
self
,
**
kwargs
):
return
Tkinter
.
Menu
(
self
.
root
,
**
kwargs
)
return
Tkinter
.
Menu
(
self
.
root
,
**
kwargs
)
...
@@ -894,7 +894,7 @@ class MessageTest(AbstractWidgetTest, unittest.TestCase):
...
@@ -894,7 +894,7 @@ class MessageTest(AbstractWidgetTest, unittest.TestCase):
'justify'
,
'padx'
,
'pady'
,
'relief'
,
'justify'
,
'padx'
,
'pady'
,
'relief'
,
'takefocus'
,
'text'
,
'textvariable'
,
'width'
,
'takefocus'
,
'text'
,
'textvariable'
,
'width'
,
)
)
_conv_pad_pixels
=
noconv
_conv_pad_pixels
=
noconv
_meth
def
_create
(
self
,
**
kwargs
):
def
_create
(
self
,
**
kwargs
):
return
Tkinter
.
Message
(
self
.
root
,
**
kwargs
)
return
Tkinter
.
Message
(
self
.
root
,
**
kwargs
)
...
...
Lib/lib-tk/test/test_ttk/test_widgets.py
View file @
4a21726f
...
@@ -7,7 +7,7 @@ import sys
...
@@ -7,7 +7,7 @@ import sys
import
support
import
support
from
test_functions
import
MockTclObj
,
MockStateSpec
from
test_functions
import
MockTclObj
,
MockStateSpec
from
support
import
tcl_version
from
support
import
tcl_version
from
widget_tests
import
(
add_standard_options
,
noconv
,
from
widget_tests
import
(
add_standard_options
,
noconv
,
noconv_meth
,
AbstractWidgetTest
,
StandardOptionsTests
,
AbstractWidgetTest
,
StandardOptionsTests
,
IntegerSizeTests
,
PixelSizeTests
)
IntegerSizeTests
,
PixelSizeTests
)
...
@@ -117,7 +117,7 @@ class WidgetTest(unittest.TestCase):
...
@@ -117,7 +117,7 @@ class WidgetTest(unittest.TestCase):
class
AbstractToplevelTest
(
AbstractWidgetTest
,
PixelSizeTests
):
class
AbstractToplevelTest
(
AbstractWidgetTest
,
PixelSizeTests
):
_conv_pixels
=
noconv
_conv_pixels
=
noconv
_meth
@
add_standard_options
(
StandardTtkOptionsTests
)
@
add_standard_options
(
StandardTtkOptionsTests
)
...
@@ -197,7 +197,7 @@ class LabelTest(AbstractLabelTest, unittest.TestCase):
...
@@ -197,7 +197,7 @@ class LabelTest(AbstractLabelTest, unittest.TestCase):
'takefocus'
,
'text'
,
'textvariable'
,
'takefocus'
,
'text'
,
'textvariable'
,
'underline'
,
'width'
,
'wraplength'
,
'underline'
,
'width'
,
'wraplength'
,
)
)
_conv_pixels
=
noconv
_conv_pixels
=
noconv
_meth
def
_create
(
self
,
**
kwargs
):
def
_create
(
self
,
**
kwargs
):
return
ttk
.
Label
(
self
.
root
,
**
kwargs
)
return
ttk
.
Label
(
self
.
root
,
**
kwargs
)
...
@@ -362,7 +362,7 @@ class ComboboxTest(AbstractWidgetTest, unittest.TestCase):
...
@@ -362,7 +362,7 @@ class ComboboxTest(AbstractWidgetTest, unittest.TestCase):
expected
=
(
'mon'
,
'tue'
,
'wed'
,
'thur'
))
expected
=
(
'mon'
,
'tue'
,
'wed'
,
'thur'
))
self
.
checkParam
(
self
.
combo
,
'values'
,
(
'mon'
,
'tue'
,
'wed'
,
'thur'
))
self
.
checkParam
(
self
.
combo
,
'values'
,
(
'mon'
,
'tue'
,
'wed'
,
'thur'
))
self
.
checkParam
(
self
.
combo
,
'values'
,
(
42
,
3.14
,
''
,
'any string'
))
self
.
checkParam
(
self
.
combo
,
'values'
,
(
42
,
3.14
,
''
,
'any string'
))
self
.
checkParam
(
self
.
combo
,
'values'
,
''
)
self
.
checkParam
(
self
.
combo
,
'values'
,
()
if
tcl_version
<
(
8
,
5
)
else
''
)
self
.
combo
[
'values'
]
=
[
'a'
,
1
,
'c'
]
self
.
combo
[
'values'
]
=
[
'a'
,
1
,
'c'
]
...
@@ -758,7 +758,7 @@ class ScaleTest(AbstractWidgetTest, unittest.TestCase):
...
@@ -758,7 +758,7 @@ class ScaleTest(AbstractWidgetTest, unittest.TestCase):
'class'
,
'command'
,
'cursor'
,
'from'
,
'length'
,
'class'
,
'command'
,
'cursor'
,
'from'
,
'length'
,
'orient'
,
'style'
,
'takefocus'
,
'to'
,
'value'
,
'variable'
,
'orient'
,
'style'
,
'takefocus'
,
'to'
,
'value'
,
'variable'
,
)
)
_conv_pixels
=
noconv
_conv_pixels
=
noconv
_meth
default_orient
=
'horizontal'
default_orient
=
'horizontal'
def
setUp
(
self
):
def
setUp
(
self
):
...
@@ -862,7 +862,7 @@ class ProgressbarTest(AbstractWidgetTest, unittest.TestCase):
...
@@ -862,7 +862,7 @@ class ProgressbarTest(AbstractWidgetTest, unittest.TestCase):
'mode'
,
'maximum'
,
'phase'
,
'mode'
,
'maximum'
,
'phase'
,
'style'
,
'takefocus'
,
'value'
,
'variable'
,
'style'
,
'takefocus'
,
'value'
,
'variable'
,
)
)
_conv_pixels
=
noconv
_conv_pixels
=
noconv
_meth
default_orient
=
'horizontal'
default_orient
=
'horizontal'
def
_create
(
self
,
**
kwargs
):
def
_create
(
self
,
**
kwargs
):
...
@@ -1144,7 +1144,7 @@ class TreeviewTest(AbstractWidgetTest, unittest.TestCase):
...
@@ -1144,7 +1144,7 @@ class TreeviewTest(AbstractWidgetTest, unittest.TestCase):
self
.
checkParam
(
widget
,
'columns'
,
'a b c'
,
self
.
checkParam
(
widget
,
'columns'
,
'a b c'
,
expected
=
(
'a'
,
'b'
,
'c'
))
expected
=
(
'a'
,
'b'
,
'c'
))
self
.
checkParam
(
widget
,
'columns'
,
(
'a'
,
'b'
,
'c'
))
self
.
checkParam
(
widget
,
'columns'
,
(
'a'
,
'b'
,
'c'
))
self
.
checkParam
(
widget
,
'columns'
,
''
)
self
.
checkParam
(
widget
,
'columns'
,
()
if
tcl_version
<
(
8
,
5
)
else
''
)
def
test_displaycolumns
(
self
):
def
test_displaycolumns
(
self
):
widget
=
self
.
create
()
widget
=
self
.
create
()
...
...
Lib/lib-tk/test/widget_tests.py
View file @
4a21726f
...
@@ -6,6 +6,7 @@ from test_ttk.support import tcl_version, requires_tcl, pixels_conv, tcl_obj_eq
...
@@ -6,6 +6,7 @@ from test_ttk.support import tcl_version, requires_tcl, pixels_conv, tcl_obj_eq
noconv
=
str
if
tcl_version
<
(
8
,
5
)
else
False
noconv
=
str
if
tcl_version
<
(
8
,
5
)
else
False
noconv_meth
=
noconv
and
staticmethod
(
noconv
)
def
int_round
(
x
):
def
int_round
(
x
):
return
int
(
round
(
x
))
return
int
(
round
(
x
))
...
@@ -13,7 +14,7 @@ def int_round(x):
...
@@ -13,7 +14,7 @@ def int_round(x):
_sentinel
=
object
()
_sentinel
=
object
()
class
AbstractWidgetTest
(
object
):
class
AbstractWidgetTest
(
object
):
_conv_pixels
=
staticmethod
(
int_round
)
if
tcl_version
[:
2
]
!=
(
8
,
5
)
else
int
_conv_pixels
=
staticmethod
(
int_round
if
tcl_version
[:
2
]
!=
(
8
,
5
)
else
int
)
_conv_pad_pixels
=
None
_conv_pad_pixels
=
None
wantobjects
=
True
wantobjects
=
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment