On Mon, 21 Jan 2013 12:06:25 +0100 (CET) serhiy.storchaka <python-check...@python.org> wrote: > diff --git a/Lib/test/test_ucn.py b/Lib/test/test_ucn.py > --- a/Lib/test/test_ucn.py > +++ b/Lib/test/test_ucn.py > @@ -144,13 +144,14 @@ > # very very long bogus character name > try: > x = b'\\N{SPACE' + b'x' * int(_testcapi.UINT_MAX + 1) + b'}' > + self.assertEqual(len(x), len(b'\\N{SPACE}') + > + (_testcapi.UINT_MAX + 1)) > + self.assertRaisesRegexp(UnicodeError, > + 'unknown Unicode character name', > + x.decode, 'unicode-escape' > + ) > except MemoryError: > raise unittest.SkipTest("not enough memory") > - self.assertEqual(len(x), len(b'\\N{SPACE}') + (_testcapi.UINT_MAX + > 1)) > - self.assertRaisesRegexp(UnicodeError, > - 'unknown Unicode character name', > - x.decode, 'unicode-escape' > - )
You can't just do that. The test may end up swapping a lot and make the machine grind to a halt, rather than raise MemoryError. This threatens to make life miserable for anyone who hasn't enough RAM, but has enough swap to fit the test's working set. Really, you have to use a bigmem decorator. Regards Antoine. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com