##// END OF EJS Templates
Merge pull request #12309 from meeseeksmachine/auto-backport-of-pr-12307-on-7.x
Matthias Bussonnier -
r25731:7b44af49 merge
parent child Browse files
Show More
@@ -8,7 +8,7 b' import nose.tools as nt'
8 8 from textwrap import dedent, indent
9 9 from unittest import TestCase
10 10 from IPython.testing.decorators import skip_without
11
11 import sys
12 12
13 13 iprc = lambda x: ip.run_cell(dedent(x)).raise_error()
14 14 iprc_nr = lambda x: ip.run_cell(dedent(x))
@@ -275,10 +275,13 b' class AsyncTest(TestCase):'
275 275 await sleep(0.1)
276 276 """
277 277 )
278
279 def test_memory_error(self):
280 with self.assertRaises(MemoryError):
281 iprc("(" * 200 + ")" * 200)
278
279 if sys.version_info < (3,9):
280 # new pgen parser in 3.9 does not raise MemoryError on too many nested
281 # parens anymore
282 def test_memory_error(self):
283 with self.assertRaises(MemoryError):
284 iprc("(" * 200 + ")" * 200)
282 285
283 286 @skip_without('curio')
284 287 def test_autoawait_curio(self):
@@ -421,6 +421,14 b' def test_render_signature_long():'
421 421 long_function.__name__,
422 422 )
423 423 nt.assert_in(sig, [
424 # Python >=3.9
425 '''\
426 long_function(
427 a_really_long_parameter: int,
428 and_another_long_one: bool = False,
429 let_us_make_sure_this_is_looong: Optional[str] = None,
430 ) -> bool\
431 ''',
424 432 # Python >=3.7
425 433 '''\
426 434 long_function(
@@ -252,12 +252,16 b' bar()'
252 252 with tt.AssertPrints('QWERTY'):
253 253 ip.showsyntaxerror()
254 254
255
256 class MemoryErrorTest(unittest.TestCase):
257 def test_memoryerror(self):
258 memoryerror_code = "(" * 200 + ")" * 200
259 with tt.AssertPrints("MemoryError"):
260 ip.run_cell(memoryerror_code)
255 import sys
256 if sys.version_info < (3,9):
257 """
258 New 3.9 Pgen Parser does not raise Memory error, except on failed malloc.
259 """
260 class MemoryErrorTest(unittest.TestCase):
261 def test_memoryerror(self):
262 memoryerror_code = "(" * 200 + ")" * 200
263 with tt.AssertPrints("MemoryError"):
264 ip.run_cell(memoryerror_code)
261 265
262 266
263 267 class Python3ChainedExceptionsTest(unittest.TestCase):
General Comments 0
You need to be logged in to leave comments. Login now