Back to index

python3.2  3.2.2
Public Member Functions | Private Member Functions
test.test_parser.ParserStackLimitTestCase Class Reference

List of all members.

Public Member Functions

def test_deeply_nested_list
def test_trigger_memory_error

Private Member Functions

def _nested_expression

Detailed Description

try to push the parser to/over its limits.
see http://bugs.python.org/issue1881 for a discussion

Definition at line 530 of file test_parser.py.


Member Function Documentation

def test.test_parser.ParserStackLimitTestCase._nested_expression (   self,
  level 
) [private]

Definition at line 534 of file test_parser.py.

00534 
00535     def _nested_expression(self, level):
00536         return "["*level+"]"*level

Here is the caller graph for this function:

Definition at line 537 of file test_parser.py.

00537 
00538     def test_deeply_nested_list(self):
00539         # XXX used to be 99 levels in 2.x
00540         e = self._nested_expression(93)
00541         st = parser.expr(e)
00542         st.compile()

Here is the call graph for this function:

Definition at line 543 of file test_parser.py.

00543 
00544     def test_trigger_memory_error(self):
00545         e = self._nested_expression(100)
00546         print("Expecting 's_push: parser stack overflow' in next line",
00547               file=sys.stderr)
00548         sys.stderr.flush()
00549         self.assertRaises(MemoryError, parser.expr, e)

Here is the call graph for this function:


The documentation for this class was generated from the following file: