annotate Lib/test/test_longexp.py @ 54294:dba767bc3155 legacy-trunk

remove mention of old ctypes version
author Benjamin Peterson <benjamin@python.org>
date Sat, 23 May 2009 20:59:09 +0000
parents 95695cc45cdd
children 9c930a32cebb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30247
95695cc45cdd SF patch #736962: Port tests to unittest
Raymond Hettinger <python@rcn.com>
parents: 24237
diff changeset
1 import unittest
95695cc45cdd SF patch #736962: Port tests to unittest
Raymond Hettinger <python@rcn.com>
parents: 24237
diff changeset
2 from test import test_support
12971
bc0d49680aa3 verify that Python raises SyntaxError for long and deeply-nested expressions
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
diff changeset
3
30247
95695cc45cdd SF patch #736962: Port tests to unittest
Raymond Hettinger <python@rcn.com>
parents: 24237
diff changeset
4 class LongExpText(unittest.TestCase):
95695cc45cdd SF patch #736962: Port tests to unittest
Raymond Hettinger <python@rcn.com>
parents: 24237
diff changeset
5 def test_longexp(self):
95695cc45cdd SF patch #736962: Port tests to unittest
Raymond Hettinger <python@rcn.com>
parents: 24237
diff changeset
6 REPS = 65580
95695cc45cdd SF patch #736962: Port tests to unittest
Raymond Hettinger <python@rcn.com>
parents: 24237
diff changeset
7 l = eval("[" + "2," * REPS + "]")
95695cc45cdd SF patch #736962: Port tests to unittest
Raymond Hettinger <python@rcn.com>
parents: 24237
diff changeset
8 self.assertEqual(len(l), REPS)
95695cc45cdd SF patch #736962: Port tests to unittest
Raymond Hettinger <python@rcn.com>
parents: 24237
diff changeset
9
95695cc45cdd SF patch #736962: Port tests to unittest
Raymond Hettinger <python@rcn.com>
parents: 24237
diff changeset
10 def test_main():
95695cc45cdd SF patch #736962: Port tests to unittest
Raymond Hettinger <python@rcn.com>
parents: 24237
diff changeset
11 test_support.run_unittest(LongExpText)
95695cc45cdd SF patch #736962: Port tests to unittest
Raymond Hettinger <python@rcn.com>
parents: 24237
diff changeset
12
95695cc45cdd SF patch #736962: Port tests to unittest
Raymond Hettinger <python@rcn.com>
parents: 24237
diff changeset
13 if __name__=="__main__":
95695cc45cdd SF patch #736962: Port tests to unittest
Raymond Hettinger <python@rcn.com>
parents: 24237
diff changeset
14 test_main()