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
676161a8
Kaydet (Commit)
676161a8
authored
Eki 10, 2009
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Rolled back revisions 74556 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
üst
38c34ef5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
20 deletions
+0
-20
unittest.rst
Doc/library/unittest.rst
+0
-4
test_unittest.py
Lib/test/test_unittest.py
+0
-15
case.py
Lib/unittest/case.py
+0
-1
No files found.
Doc/library/unittest.rst
Dosyayı görüntüle @
676161a8
...
@@ -891,10 +891,6 @@ Test cases
...
@@ -891,10 +891,6 @@ Test cases
with self.failUnlessRaises(some_error_class):
with self.failUnlessRaises(some_error_class):
do_something()
do_something()
The context manager will store the caught exception object in its
:attr:`exc_value` attribute. This can be useful if the intention
is to perform additional checks on the exception raised.
.. versionchanged:: 3.1
.. versionchanged:: 3.1
Added the ability to use :meth:`assertRaises` as a context manager.
Added the ability to use :meth:`assertRaises` as a context manager.
...
...
Lib/test/test_unittest.py
Dosyayı görüntüle @
676161a8
...
@@ -2846,21 +2846,6 @@ test case
...
@@ -2846,21 +2846,6 @@ test case
self
.
assertRaisesRegexp
,
Exception
,
self
.
assertRaisesRegexp
,
Exception
,
re
.
compile
(
'^Expected$'
),
Stub
)
re
.
compile
(
'^Expected$'
),
Stub
)
def
testAssertRaisesExcValue
(
self
):
class
ExceptionMock
(
Exception
):
pass
def
Stub
(
foo
):
raise
ExceptionMock
(
foo
)
v
=
"particular value"
ctx
=
self
.
assertRaises
(
ExceptionMock
)
with
ctx
:
Stub
(
v
)
e
=
ctx
.
exc_value
self
.
assertTrue
(
isinstance
(
e
,
ExceptionMock
))
self
.
assertEqual
(
e
.
args
[
0
],
v
)
def
testSynonymAssertMethodNames
(
self
):
def
testSynonymAssertMethodNames
(
self
):
"""Test undocumented method name synonyms.
"""Test undocumented method name synonyms.
...
...
Lib/unittest/case.py
Dosyayı görüntüle @
676161a8
...
@@ -116,7 +116,6 @@ class _AssertRaisesContext(object):
...
@@ -116,7 +116,6 @@ class _AssertRaisesContext(object):
if
not
issubclass
(
exc_type
,
self
.
expected
):
if
not
issubclass
(
exc_type
,
self
.
expected
):
# let unexpected exceptions pass through
# let unexpected exceptions pass through
return
False
return
False
self
.
exc_value
=
exc_value
#store for later retrieval
if
self
.
expected_regex
is
None
:
if
self
.
expected_regex
is
None
:
return
True
return
True
...
...
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