##// END OF EJS Templates
Add failing test for IndentationError display
Thomas Kluyver -
Show More
@@ -73,3 +73,23 b' class NonAsciiTest(unittest.TestCase):'
73 with tt.AssertPrints("ZeroDivisionError"):
73 with tt.AssertPrints("ZeroDivisionError"):
74 with tt.AssertPrints(u'дбИЖ', suppress=False):
74 with tt.AssertPrints(u'дбИЖ', suppress=False):
75 ip.run_cell('fail()')
75 ip.run_cell('fail()')
76
77 indentationerror_file = """if True:
78 zoon()
79 """
80
81 class IndentationErrorTest(unittest.TestCase):
82 def test_indentationerror_shows_line(self):
83 # See issue gh-2398
84 with tt.AssertPrints("IndentationError"):
85 with tt.AssertPrints("zoon()", suppress=False):
86 ip.run_cell(indentationerror_file)
87
88 with TemporaryDirectory() as td:
89 fname = os.path.join(td, "foo.py")
90 with open(fname, "w") as f:
91 f.write(indentationerror_file)
92
93 with tt.AssertPrints("IndentationError"):
94 with tt.AssertPrints("zoon()", suppress=False):
95 ip.magic('run %s' % fname)
General Comments 0
You need to be logged in to leave comments. Login now