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
da9eeae4
Kaydet (Commit)
da9eeae4
authored
Mar 09, 2013
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#11963: avoid printing messages in test_parser. Initial patch by Éric Araujo.
üst
26e2faf5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
test_parser.py
Lib/test/test_parser.py
+6
-3
No files found.
Lib/test/test_parser.py
Dosyayı görüntüle @
da9eeae4
...
@@ -3,6 +3,7 @@ import unittest
...
@@ -3,6 +3,7 @@ import unittest
import
sys
import
sys
import
struct
import
struct
from
test
import
test_support
as
support
from
test
import
test_support
as
support
from
test.script_helper
import
assert_python_failure
#
#
# First, we test that we can generate trees from valid source fragments,
# First, we test that we can generate trees from valid source fragments,
...
@@ -579,7 +580,7 @@ class CompileTestCase(unittest.TestCase):
...
@@ -579,7 +580,7 @@ class CompileTestCase(unittest.TestCase):
class
ParserStackLimitTestCase
(
unittest
.
TestCase
):
class
ParserStackLimitTestCase
(
unittest
.
TestCase
):
"""try to push the parser to/over it
'
s limits.
"""try to push the parser to/over its limits.
see http://bugs.python.org/issue1881 for a discussion
see http://bugs.python.org/issue1881 for a discussion
"""
"""
def
_nested_expression
(
self
,
level
):
def
_nested_expression
(
self
,
level
):
...
@@ -592,8 +593,10 @@ class ParserStackLimitTestCase(unittest.TestCase):
...
@@ -592,8 +593,10 @@ class ParserStackLimitTestCase(unittest.TestCase):
def
test_trigger_memory_error
(
self
):
def
test_trigger_memory_error
(
self
):
e
=
self
.
_nested_expression
(
100
)
e
=
self
.
_nested_expression
(
100
)
print
>>
sys
.
stderr
,
"Expecting 's_push: parser stack overflow' in next line"
rc
,
out
,
err
=
assert_python_failure
(
'-c'
,
e
)
self
.
assertRaises
(
MemoryError
,
parser
.
expr
,
e
)
# parsing the expression will result in an error message
# followed by a MemoryError (see #11963)
self
.
assertEqual
(
err
,
b
's_push: parser stack overflow
\n
MemoryError'
)
class
STObjectTestCase
(
unittest
.
TestCase
):
class
STObjectTestCase
(
unittest
.
TestCase
):
"""Test operations on ST objects themselves"""
"""Test operations on ST objects themselves"""
...
...
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