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
462c357d
Kaydet (Commit)
462c357d
authored
Nis 22, 2015
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed full Tcl version parsing in tests for pre-final versions.
üst
333518e0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
27 deletions
+23
-27
test_tcl.py
Lib/test/test_tcl.py
+11
-15
support.py
Lib/tkinter/test/support.py
+10
-10
test_widgets.py
Lib/tkinter/test/test_ttk/test_widgets.py
+2
-2
No files found.
Lib/test/test_tcl.py
Dosyayı görüntüle @
462c357d
import
unittest
import
unittest
import
re
import
sys
import
sys
import
os
import
os
from
test
import
support
from
test
import
support
...
@@ -17,27 +18,22 @@ try:
...
@@ -17,27 +18,22 @@ try:
except
ImportError
:
except
ImportError
:
INT_MAX
=
PY_SSIZE_T_MAX
=
sys
.
maxsize
INT_MAX
=
PY_SSIZE_T_MAX
=
sys
.
maxsize
tcl_version
=
_tkinter
.
TCL_VERSION
.
split
(
'.'
)
tcl_version
=
tuple
(
map
(
int
,
_tkinter
.
TCL_VERSION
.
split
(
'.'
)))
try
:
for
i
in
range
(
len
(
tcl_version
)):
tcl_version
[
i
]
=
int
(
tcl_version
[
i
])
except
ValueError
:
pass
tcl_version
=
tuple
(
tcl_version
)
_tk_patchlevel
=
None
_tk_patchlevel
=
None
def
get_tk_patchlevel
():
def
get_tk_patchlevel
():
global
_tk_patchlevel
global
_tk_patchlevel
if
_tk_patchlevel
is
None
:
if
_tk_patchlevel
is
None
:
tcl
=
Tcl
()
tcl
=
Tcl
()
patchlevel
=
[]
patchlevel
=
tcl
.
call
(
'info'
,
'patchlevel'
)
for
x
in
tcl
.
call
(
'info'
,
'patchlevel'
)
.
split
(
'.'
):
m
=
re
.
fullmatch
(
r'(\d+)\.(\d+)([ab.])(\d+)'
,
patchlevel
)
try
:
major
,
minor
,
releaselevel
,
serial
=
m
.
groups
()
x
=
int
(
x
,
10
)
major
,
minor
,
serial
=
int
(
major
),
int
(
minor
),
int
(
serial
)
except
ValueError
:
releaselevel
=
{
'a'
:
'alpha'
,
'b'
:
'beta'
,
'.'
:
'final'
}[
releaselevel
]
x
=
-
1
if
releaselevel
==
'final'
:
patchlevel
.
append
(
x
)
_tk_patchlevel
=
major
,
minor
,
serial
,
releaselevel
,
0
_tk_patchlevel
=
tuple
(
patchlevel
)
else
:
_tk_patchlevel
=
major
,
minor
,
0
,
releaselevel
,
serial
return
_tk_patchlevel
return
_tk_patchlevel
...
...
Lib/tkinter/test/support.py
Dosyayı görüntüle @
462c357d
import
sys
import
re
import
tkinter
import
tkinter
import
unittest
import
unittest
from
test.support
import
requires
class
AbstractTkTest
:
class
AbstractTkTest
:
...
@@ -63,14 +62,15 @@ def get_tk_patchlevel():
...
@@ -63,14 +62,15 @@ def get_tk_patchlevel():
global
_tk_patchlevel
global
_tk_patchlevel
if
_tk_patchlevel
is
None
:
if
_tk_patchlevel
is
None
:
tcl
=
tkinter
.
Tcl
()
tcl
=
tkinter
.
Tcl
()
patchlevel
=
[]
patchlevel
=
tcl
.
call
(
'info'
,
'patchlevel'
)
for
x
in
tcl
.
call
(
'info'
,
'patchlevel'
)
.
split
(
'.'
):
m
=
re
.
fullmatch
(
r'(\d+)\.(\d+)([ab.])(\d+)'
,
patchlevel
)
try
:
major
,
minor
,
releaselevel
,
serial
=
m
.
groups
()
x
=
int
(
x
,
10
)
major
,
minor
,
serial
=
int
(
major
),
int
(
minor
),
int
(
serial
)
except
ValueError
:
releaselevel
=
{
'a'
:
'alpha'
,
'b'
:
'beta'
,
'.'
:
'final'
}[
releaselevel
]
x
=
-
1
if
releaselevel
==
'final'
:
patchlevel
.
append
(
x
)
_tk_patchlevel
=
major
,
minor
,
serial
,
releaselevel
,
0
_tk_patchlevel
=
tuple
(
patchlevel
)
else
:
_tk_patchlevel
=
major
,
minor
,
0
,
releaselevel
,
serial
return
_tk_patchlevel
return
_tk_patchlevel
units
=
{
units
=
{
...
...
Lib/tkinter/test/test_ttk/test_widgets.py
Dosyayı görüntüle @
462c357d
...
@@ -20,7 +20,7 @@ class StandardTtkOptionsTests(StandardOptionsTests):
...
@@ -20,7 +20,7 @@ class StandardTtkOptionsTests(StandardOptionsTests):
widget
=
self
.
create
()
widget
=
self
.
create
()
self
.
assertEqual
(
widget
[
'class'
],
''
)
self
.
assertEqual
(
widget
[
'class'
],
''
)
errmsg
=
'attempt to change read-only option'
errmsg
=
'attempt to change read-only option'
if
get_tk_patchlevel
()
<
(
8
,
6
,
0
):
# actually this was changed in 8.6b3
if
get_tk_patchlevel
()
<
(
8
,
6
,
0
,
'beta'
,
3
):
errmsg
=
'Attempt to change read-only option'
errmsg
=
'Attempt to change read-only option'
self
.
checkInvalidParam
(
widget
,
'class'
,
'Foo'
,
errmsg
=
errmsg
)
self
.
checkInvalidParam
(
widget
,
'class'
,
'Foo'
,
errmsg
=
errmsg
)
widget2
=
self
.
create
(
class_
=
'Foo'
)
widget2
=
self
.
create
(
class_
=
'Foo'
)
...
@@ -551,7 +551,7 @@ class PanedWindowTest(AbstractWidgetTest, unittest.TestCase):
...
@@ -551,7 +551,7 @@ class PanedWindowTest(AbstractWidgetTest, unittest.TestCase):
widget
=
self
.
create
()
widget
=
self
.
create
()
self
.
assertEqual
(
str
(
widget
[
'orient'
]),
'vertical'
)
self
.
assertEqual
(
str
(
widget
[
'orient'
]),
'vertical'
)
errmsg
=
'attempt to change read-only option'
errmsg
=
'attempt to change read-only option'
if
get_tk_patchlevel
()
<
(
8
,
6
,
0
):
# actually this was changed in 8.6b3
if
get_tk_patchlevel
()
<
(
8
,
6
,
0
,
'beta'
,
3
):
errmsg
=
'Attempt to change read-only option'
errmsg
=
'Attempt to change read-only option'
self
.
checkInvalidParam
(
widget
,
'orient'
,
'horizontal'
,
self
.
checkInvalidParam
(
widget
,
'orient'
,
'horizontal'
,
errmsg
=
errmsg
)
errmsg
=
errmsg
)
...
...
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