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
b3d188f7
Kaydet (Commit)
b3d188f7
authored
Ara 02, 2011
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
#8414: merge with 3.2.
üst
47862d4c
6cc5bf76
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
test_grammar.py
Lib/test/test_grammar.py
+24
-2
No files found.
Lib/test/test_grammar.py
Dosyayı görüntüle @
b3d188f7
...
...
@@ -500,13 +500,35 @@ class GrammarTests(unittest.TestCase):
assert
1
,
1
assert
lambda
x
:
x
assert
1
,
lambda
x
:
x
+
1
try
:
assert
True
except
AssertionError
as
e
:
self
.
fail
(
"'assert True' should not have raised an AssertionError"
)
try
:
assert
True
,
'this should always pass'
except
AssertionError
as
e
:
self
.
fail
(
"'assert True, msg' should not have "
"raised an AssertionError"
)
# these tests fail if python is run with -O, so check __debug__
@unittest.skipUnless
(
__debug__
,
"Won't work if __debug__ is False"
)
def
testAssert2
(
self
):
try
:
assert
0
,
"msg"
except
AssertionError
as
e
:
self
.
assertEqual
(
e
.
args
[
0
],
"msg"
)
else
:
if
__debug__
:
self
.
fail
(
"AssertionError not raised by assert 0"
)
self
.
fail
(
"AssertionError not raised by assert 0"
)
try
:
assert
False
except
AssertionError
as
e
:
self
.
assertEqual
(
len
(
e
.
args
),
0
)
else
:
self
.
fail
(
"AssertionError not raised by 'assert False'"
)
### compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef
# Tested below
...
...
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