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
40e47f69
Kaydet (Commit)
40e47f69
authored
Eyl 02, 2015
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge 3.5 (test_warnings)
üst
ede14ae3
4912e7a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
test_warnings.py
Lib/test/test_warnings.py
+6
-0
No files found.
Lib/test/test_warnings.py
Dosyayı görüntüle @
40e47f69
...
@@ -44,6 +44,7 @@ class BaseTest:
...
@@ -44,6 +44,7 @@ class BaseTest:
"""Basic bookkeeping required for testing."""
"""Basic bookkeeping required for testing."""
def
setUp
(
self
):
def
setUp
(
self
):
self
.
old_unittest_module
=
unittest
.
case
.
warnings
# The __warningregistry__ needs to be in a pristine state for tests
# The __warningregistry__ needs to be in a pristine state for tests
# to work properly.
# to work properly.
if
'__warningregistry__'
in
globals
():
if
'__warningregistry__'
in
globals
():
...
@@ -55,10 +56,15 @@ class BaseTest:
...
@@ -55,10 +56,15 @@ class BaseTest:
# The 'warnings' module must be explicitly set so that the proper
# The 'warnings' module must be explicitly set so that the proper
# interaction between _warnings and 'warnings' can be controlled.
# interaction between _warnings and 'warnings' can be controlled.
sys
.
modules
[
'warnings'
]
=
self
.
module
sys
.
modules
[
'warnings'
]
=
self
.
module
# Ensure that unittest.TestCase.assertWarns() uses the same warnings
# module than warnings.catch_warnings(). Otherwise,
# warnings.catch_warnings() will be unable to remove the added filter.
unittest
.
case
.
warnings
=
self
.
module
super
(
BaseTest
,
self
)
.
setUp
()
super
(
BaseTest
,
self
)
.
setUp
()
def
tearDown
(
self
):
def
tearDown
(
self
):
sys
.
modules
[
'warnings'
]
=
original_warnings
sys
.
modules
[
'warnings'
]
=
original_warnings
unittest
.
case
.
warnings
=
self
.
old_unittest_module
super
(
BaseTest
,
self
)
.
tearDown
()
super
(
BaseTest
,
self
)
.
tearDown
()
class
PublicAPITests
(
BaseTest
):
class
PublicAPITests
(
BaseTest
):
...
...
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