diff options
| author | Ezio Melotti <ezio.melotti@gmail.com> | 2013-03-09 20:21:32 (GMT) | 
|---|---|---|
| committer | Ezio Melotti <ezio.melotti@gmail.com> | 2013-03-09 20:21:32 (GMT) | 
| commit | 492390333e7786db6491da0f02ed0224bca57699 (patch) | |
| tree | 5303dd829d5f45f0b875041c651e8892f30a22b8 /Lib/test/test_parser.py | |
| parent | ff73758b8f534ff4c90f2f50e59acc85eb32f8e3 (diff) | |
| parent | 0d7333e0efc45e458932b026c7310b8c7ebb5b0b (diff) | |
| download | cpython-492390333e7786db6491da0f02ed0224bca57699.zip cpython-492390333e7786db6491da0f02ed0224bca57699.tar.gz cpython-492390333e7786db6491da0f02ed0224bca57699.tar.bz2 | |
#11963: merge with 3.3.
Diffstat (limited to 'Lib/test/test_parser.py')
| -rw-r--r-- | Lib/test/test_parser.py | 9 | 
1 files changed, 5 insertions, 4 deletions
| diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py index c93a2ca..b5e9053 100644 --- 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, @@ -611,10 +612,10 @@ class ParserStackLimitTestCase(unittest.TestCase):      def test_trigger_memory_error(self):          e = self._nested_expression(100) -        print("Expecting 's_push: parser stack overflow' in next line", -              file=sys.stderr) -        sys.stderr.flush() -        self.assertRaises(MemoryError, parser.expr, e) +        rc, out, err = assert_python_failure('-c', 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\nMemoryError')  class STObjectTestCase(unittest.TestCase):      """Test operations on ST objects themselves""" | 
