From a8e9e88396722eace52bbeb33e14284e2480e25d 2021-03-14 00:42:41 From: Blazej Michalik Date: 2021-03-14 00:42:41 Subject: [PATCH] Darken test_check_complete --- diff --git a/IPython/core/tests/test_inputtransformer2.py b/IPython/core/tests/test_inputtransformer2.py index 6db1528..e024d7c 100644 --- a/IPython/core/tests/test_inputtransformer2.py +++ b/IPython/core/tests/test_inputtransformer2.py @@ -255,18 +255,18 @@ def test_find_assign_op_dedent(): def test_check_complete(): cc = ipt2.TransformerManager().check_complete - nt.assert_equal(cc("a = 1"), ('complete', None)) - nt.assert_equal(cc("for a in range(5):"), ('incomplete', 4)) - nt.assert_equal(cc("for a in range(5):\n if a > 0:"), ('incomplete', 8)) - nt.assert_equal(cc("raise = 2"), ('invalid', None)) - nt.assert_equal(cc("a = [1,\n2,"), ('incomplete', 0)) - nt.assert_equal(cc("(\n))"), ('incomplete', 0)) - nt.assert_equal(cc("\\\r\n"), ('incomplete', 0)) - nt.assert_equal(cc("a = '''\n hi"), ('incomplete', 3)) - nt.assert_equal(cc("def a():\n x=1\n global x"), ('invalid', None)) - nt.assert_equal(cc("a \\ "), ('invalid', None)) # Nothing allowed after backslash - nt.assert_equal(cc("1\\\n+2"), ('complete', None)) - nt.assert_equal(cc("exit"), ('complete', None)) + nt.assert_equal(cc("a = 1"), ("complete", None)) + nt.assert_equal(cc("for a in range(5):"), ("incomplete", 4)) + nt.assert_equal(cc("for a in range(5):\n if a > 0:"), ("incomplete", 8)) + nt.assert_equal(cc("raise = 2"), ("invalid", None)) + nt.assert_equal(cc("a = [1,\n2,"), ("incomplete", 0)) + nt.assert_equal(cc("(\n))"), ("incomplete", 0)) + nt.assert_equal(cc("\\\r\n"), ("incomplete", 0)) + nt.assert_equal(cc("a = '''\n hi"), ("incomplete", 3)) + nt.assert_equal(cc("def a():\n x=1\n global x"), ("invalid", None)) + nt.assert_equal(cc("a \\ "), ("invalid", None)) # Nothing allowed after backslash + nt.assert_equal(cc("1\\\n+2"), ("complete", None)) + nt.assert_equal(cc("exit"), ("complete", None)) example = dedent(""" if True: