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
35246bd5
Kaydet (Commit)
35246bd5
authored
Şub 23, 2013
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
#17249: merge with 3.2.
üst
cc5ea62e
29267c81
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
28 deletions
+29
-28
test_capi.py
Lib/test/test_capi.py
+27
-28
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/test/test_capi.py
Dosyayı görüntüle @
35246bd5
...
@@ -326,9 +326,34 @@ class SkipitemTest(unittest.TestCase):
...
@@ -326,9 +326,34 @@ class SkipitemTest(unittest.TestCase):
self
.
assertRaises
(
ValueError
,
_testcapi
.
parse_tuple_and_keywords
,
self
.
assertRaises
(
ValueError
,
_testcapi
.
parse_tuple_and_keywords
,
(),
{},
b
''
,
[
42
])
(),
{},
b
''
,
[
42
])
@unittest.skipUnless
(
threading
,
'Threading required for this test.'
)
class
TestThreadState
(
unittest
.
TestCase
):
@support.reap_threads
def
test_thread_state
(
self
):
# some extra thread-state tests driven via _testcapi
def
target
():
idents
=
[]
def
callback
():
idents
.
append
(
threading
.
get_ident
())
_testcapi
.
_test_thread_state
(
callback
)
a
=
b
=
callback
time
.
sleep
(
1
)
# Check our main thread is in the list exactly 3 times.
self
.
assertEqual
(
idents
.
count
(
threading
.
get_ident
()),
3
,
"Couldn't find main thread correctly in the list"
)
target
()
t
=
threading
.
Thread
(
target
=
target
)
t
.
start
()
t
.
join
()
def
test_main
():
def
test_main
():
support
.
run_unittest
(
CAPITest
,
TestPendingCalls
,
support
.
run_unittest
(
CAPITest
,
TestPendingCalls
,
Test6012
,
Test6012
,
EmbeddingTest
,
SkipitemTest
)
EmbeddingTest
,
SkipitemTest
,
TestThreadState
)
for
name
in
dir
(
_testcapi
):
for
name
in
dir
(
_testcapi
):
if
name
.
startswith
(
'test_'
):
if
name
.
startswith
(
'test_'
):
...
@@ -337,31 +362,5 @@ def test_main():
...
@@ -337,31 +362,5 @@ def test_main():
print
(
"internal"
,
name
)
print
(
"internal"
,
name
)
test
()
test
()
# some extra thread-state tests driven via _testcapi
def
TestThreadState
():
if
support
.
verbose
:
print
(
"auto-thread-state"
)
idents
=
[]
def
callback
():
idents
.
append
(
threading
.
get_ident
())
_testcapi
.
_test_thread_state
(
callback
)
a
=
b
=
callback
time
.
sleep
(
1
)
# Check our main thread is in the list exactly 3 times.
if
idents
.
count
(
threading
.
get_ident
())
!=
3
:
raise
support
.
TestFailed
(
"Couldn't find main thread correctly in the list"
)
if
threading
:
import
time
TestThreadState
()
t
=
threading
.
Thread
(
target
=
TestThreadState
)
t
.
start
()
t
.
join
()
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
test_main
()
test_main
()
Misc/NEWS
Dosyayı görüntüle @
35246bd5
...
@@ -620,6 +620,8 @@ Extension Modules
...
@@ -620,6 +620,8 @@ Extension Modules
Tests
Tests
-----
-----
- Issue #17249: convert a test in test_capi to use unittest and reap threads.
- Issue #17041: Fix testing when Python is configured with the
- Issue #17041: Fix testing when Python is configured with the
--without-doc-strings.
--without-doc-strings.
...
...
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