[Python-Dev] Memory tests in Unicode (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Sat Aug 16 17:50:34 CEST 2008
- Previous message: [Python-Dev] Memory tests in Unicode
- Next message: [Python-Dev] Memory tests in Unicode
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Facundo Batista <facundobatista gmail.com> writes:
The testraiseMemError() in testunicode.py is complicating me the regression tests: tries to use all the memory in my system, which starts to swap as crazy, and almost freezes everything. When the test finishes (always pass ok), I have all the memory flushed so it take a few seconds to go back to the normal system.
If the test does allocate the very large string, it means MemoryError isn't raised, which defeats the purpose of the test. I think that: u"a" * (sys.maxint // 2 - 100) should be replaced with: u"a" * (sys.maxsize - 100) The latter raises MemoryError reliably here, while the former doesn't.
An assertRaises could also be used in place of the try/except, it would ensure the test does exercise what it is meant to exercise.
Regards
Antoine.
- Previous message: [Python-Dev] Memory tests in Unicode
- Next message: [Python-Dev] Memory tests in Unicode
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]