cpython: 10a82140f36d (original) (raw)
Mercurial > cpython
changeset 82575:10a82140f36d 3.2
#11963: avoid printing messages in test_parser. Initial patch by Éric Araujo. [#11963]
Ezio Melotti ezio.melotti@gmail.com | |
---|---|
date | Sat, 09 Mar 2013 22:17:33 +0200 |
parents | 0acd9408b6f1 |
children | 185c923f21ec 64b87578c071 |
files | Lib/test/test_parser.py |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-)[+] [-] Lib/test/test_parser.py 9 |
line wrap: on
line diff
--- a/Lib/test/test_parser.py +++ b/Lib/test/test_parser.py @@ -4,6 +4,7 @@ import sys import operator import struct from test import support +from test.script_helper import assert_python_failure #
First, we test that we can generate trees from valid source fragments,
@@ -607,10 +608,10 @@ class ParserStackLimitTestCase(unittest. def test_trigger_memory_error(self): e = self._nested_expression(100)
print("Expecting 's_push: parser stack overflow' in next line",[](#l1.15)
file=sys.stderr)[](#l1.16)
sys.stderr.flush()[](#l1.17)
self.assertRaises(MemoryError, parser.expr, e)[](#l1.18)
rc, out, err = assert_python_failure('-c', e)[](#l1.19)
# parsing the expression will result in an error message[](#l1.20)
# followed by a MemoryError (see #11963)[](#l1.21)
self.assertEqual(err, b's_push: parser stack overflow\nMemoryError')[](#l1.22)
class STObjectTestCase(unittest.TestCase): """Test operations on ST objects themselves"""