Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
affb9b25
Kaydet (Commit)
affb9b25
authored
Kas 09, 2013
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix Tkinter tests on Tk 8.5 with patchlevel < 8.5.11 (issue #19085).
üst
2915933f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
23 deletions
+31
-23
support.py
Lib/tkinter/test/support.py
+15
-0
test_widgets.py
Lib/tkinter/test/test_tkinter/test_widgets.py
+8
-3
widget_tests.py
Lib/tkinter/test/widget_tests.py
+8
-20
No files found.
Lib/tkinter/test/support.py
Dosyayı görüntüle @
affb9b25
...
@@ -86,6 +86,21 @@ def requires_tcl(*version):
...
@@ -86,6 +86,21 @@ def requires_tcl(*version):
return
unittest
.
skipUnless
(
tcl_version
>=
version
,
return
unittest
.
skipUnless
(
tcl_version
>=
version
,
'requires Tcl version >= '
+
'.'
.
join
(
map
(
str
,
version
)))
'requires Tcl version >= '
+
'.'
.
join
(
map
(
str
,
version
)))
_tk_patchlevel
=
None
def
get_tk_patchlevel
():
global
_tk_patchlevel
if
_tk_patchlevel
is
None
:
tcl
=
tkinter
.
Tcl
()
patchlevel
=
[]
for
x
in
tcl
.
call
(
'info'
,
'patchlevel'
)
.
split
(
'.'
):
try
:
x
=
int
(
x
,
10
)
except
ValueError
:
x
=
-
1
patchlevel
.
append
(
x
)
_tk_patchlevel
=
tuple
(
patchlevel
)
return
_tk_patchlevel
units
=
{
units
=
{
'c'
:
72
/
2.54
,
# centimeters
'c'
:
72
/
2.54
,
# centimeters
'i'
:
72
,
# inches
'i'
:
72
,
# inches
...
...
Lib/tkinter/test/test_tkinter/test_widgets.py
Dosyayı görüntüle @
affb9b25
...
@@ -3,7 +3,8 @@ import tkinter
...
@@ -3,7 +3,8 @@ import tkinter
import
os
import
os
from
test.support
import
requires
from
test.support
import
requires
from
tkinter.test.support
import
tcl_version
,
requires_tcl
,
widget_eq
from
tkinter.test.support
import
(
tcl_version
,
requires_tcl
,
get_tk_patchlevel
,
widget_eq
)
from
tkinter.test.widget_tests
import
(
from
tkinter.test.widget_tests
import
(
add_standard_options
,
noconv
,
pixels_round
,
add_standard_options
,
noconv
,
pixels_round
,
AbstractWidgetTest
,
StandardOptionsTests
,
IntegerSizeTests
,
PixelSizeTests
)
AbstractWidgetTest
,
StandardOptionsTests
,
IntegerSizeTests
,
PixelSizeTests
)
...
@@ -539,7 +540,7 @@ class TextTest(AbstractWidgetTest, unittest.TestCase):
...
@@ -539,7 +540,7 @@ class TextTest(AbstractWidgetTest, unittest.TestCase):
def
test_selectborderwidth
(
self
):
def
test_selectborderwidth
(
self
):
widget
=
self
.
create
()
widget
=
self
.
create
()
self
.
checkPixelsParam
(
widget
,
'selectborderwidth'
,
self
.
checkPixelsParam
(
widget
,
'selectborderwidth'
,
1.3
,
2.6
,
-
2
,
'10p'
,
conv
=
False
,
1.3
,
2.6
,
-
2
,
'10p'
,
conv
=
noconv
,
keep_orig
=
tcl_version
>=
(
8
,
5
))
keep_orig
=
tcl_version
>=
(
8
,
5
))
def
test_spacing1
(
self
):
def
test_spacing1
(
self
):
...
@@ -580,7 +581,11 @@ class TextTest(AbstractWidgetTest, unittest.TestCase):
...
@@ -580,7 +581,11 @@ class TextTest(AbstractWidgetTest, unittest.TestCase):
def
test_tabs
(
self
):
def
test_tabs
(
self
):
widget
=
self
.
create
()
widget
=
self
.
create
()
self
.
checkParam
(
widget
,
'tabs'
,
(
10.2
,
20.7
,
'1i'
,
'2i'
))
if
get_tk_patchlevel
()
<
(
8
,
5
,
11
):
self
.
checkParam
(
widget
,
'tabs'
,
(
10.2
,
20.7
,
'1i'
,
'2i'
),
expected
=
(
'10.2'
,
'20.7'
,
'1i'
,
'2i'
))
else
:
self
.
checkParam
(
widget
,
'tabs'
,
(
10.2
,
20.7
,
'1i'
,
'2i'
))
self
.
checkParam
(
widget
,
'tabs'
,
'10.2 20.7 1i 2i'
,
self
.
checkParam
(
widget
,
'tabs'
,
'10.2 20.7 1i 2i'
,
expected
=
(
'10.2'
,
'20.7'
,
'1i'
,
'2i'
))
expected
=
(
'10.2'
,
'20.7'
,
'1i'
,
'2i'
))
self
.
checkParam
(
widget
,
'tabs'
,
'2c left 4c 6c center'
,
self
.
checkParam
(
widget
,
'tabs'
,
'2c left 4c 6c center'
,
...
...
Lib/tkinter/test/widget_tests.py
Dosyayı görüntüle @
affb9b25
...
@@ -2,28 +2,19 @@
...
@@ -2,28 +2,19 @@
import
tkinter
import
tkinter
from
tkinter.ttk
import
setup_master
,
Scale
from
tkinter.ttk
import
setup_master
,
Scale
from
tkinter.test.support
import
(
tcl_version
,
requires_tcl
,
pixels_conv
,
from
tkinter.test.support
import
(
tcl_version
,
requires_tcl
,
get_tk_patchlevel
,
tcl_obj_eq
)
pixels_conv
,
tcl_obj_eq
)
noconv
=
str
if
tcl_version
<
(
8
,
5
)
else
False
noconv
=
False
if
get_tk_patchlevel
()
<
(
8
,
5
,
11
):
noconv
=
str
pixels_round
=
round
pixels_round
=
round
if
tcl_version
[:
2
]
==
(
8
,
5
):
if
get_tk_patchlevel
()[:
3
]
==
(
8
,
5
,
11
):
# Issue #19085: Workaround a bug in Tk
# Issue #19085: Workaround a bug in Tk
# http://core.tcl.tk/tk/info/3497848
# http://core.tcl.tk/tk/info/3497848
_pixels_round
=
None
pixels_round
=
int
def
pixels_round
(
x
):
global
_pixels_round
if
_pixels_round
is
None
:
root
=
setup_master
()
patchlevel
=
root
.
call
(
'info'
,
'patchlevel'
)
patchlevel
=
tuple
(
map
(
int
,
patchlevel
.
split
(
'.'
)))
if
patchlevel
<
(
8
,
5
,
12
):
_pixels_round
=
int
else
:
_pixels_round
=
round
return
_pixels_round
(
x
)
_sentinel
=
object
()
_sentinel
=
object
()
...
@@ -406,10 +397,7 @@ class StandardOptionsTests:
...
@@ -406,10 +397,7 @@ class StandardOptionsTests:
def
test_wraplength
(
self
):
def
test_wraplength
(
self
):
widget
=
self
.
create
()
widget
=
self
.
create
()
if
tcl_version
<
(
8
,
5
):
self
.
checkPixelsParam
(
widget
,
'wraplength'
,
100
)
self
.
checkPixelsParam
(
widget
,
'wraplength'
,
100
)
else
:
self
.
checkParams
(
widget
,
'wraplength'
,
100
)
def
test_xscrollcommand
(
self
):
def
test_xscrollcommand
(
self
):
widget
=
self
.
create
()
widget
=
self
.
create
()
...
...
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