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
d9d147b8
Kaydet (Commit)
d9d147b8
authored
Nis 27, 2010
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #7449, part 1: fix test_support.py for Python compiled without thread
üst
ae9f8bd2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
test_support.py
Lib/test/test_support.py
+18
-4
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/test/test_support.py
Dosyayı görüntüle @
d9d147b8
...
...
@@ -18,6 +18,10 @@ import importlib
import
UserDict
import
re
import
time
try
:
import
thread
except
ImportError
:
thread
=
None
__all__
=
[
"Error"
,
"TestFailed"
,
"ResourceDenied"
,
"import_module"
,
"verbose"
,
"use_resources"
,
"max_memuse"
,
"record_original_stdout"
,
...
...
@@ -44,7 +48,7 @@ class ResourceDenied(unittest.SkipTest):
"""Test skipped because it requested a disallowed resource.
This is raised when a test calls requires() for a resource that
has not be enabled. It is used to distinguish between expected
has not be
en
enabled. It is used to distinguish between expected
and unexpected skips.
"""
...
...
@@ -1078,11 +1082,14 @@ def run_doctest(module, verbosity=None):
# at the end of a test run.
def
threading_setup
():
import
thread
return
thread
.
_count
(),
if
thread
:
return
thread
.
_count
(),
else
:
return
1
,
def
threading_cleanup
(
nb_threads
):
import
thread
if
not
thread
:
return
_MAX_COUNT
=
10
for
count
in
range
(
_MAX_COUNT
):
...
...
@@ -1093,6 +1100,13 @@ def threading_cleanup(nb_threads):
# XXX print a warning in case of failure?
def
reap_threads
(
func
):
"""Use this function when threads are being used. This will
ensure that the threads are cleaned up even when the test fails.
If threading is unavailable this function does nothing.
"""
if
not
thread
:
return
func
@functools.wraps
(
func
)
def
decorator
(
*
args
):
key
=
threading_setup
()
...
...
Misc/NEWS
Dosyayı görüntüle @
d9d147b8
...
...
@@ -109,6 +109,8 @@ Extension Modules
Tests
-----
- Issue #7449: Fix many tests to support Python compiled without thread support
- Issue #8108: test_ftplib's non-blocking SSL server now has proper handling
of SSL shutdowns.
...
...
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