Facundo Batista <facundobatista <at> gmail.com> writes: > > The test_raiseMemError() in test_unicode.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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4