'Traceback produced if the line where the error occurred is missing?
https://github.com/ipython/ipython/issues/1456'

def test_changing_py_file(self):

    with TemporaryDirectory() as td:
        fname = os.path.join(td, 'foo.py')
        with open(fname, 'w') as f:
            f.write(file_1)
        with prepended_to_syspath(td):
            ip.run_cell('import    foo')
        with tt.AssertPrints('ZeroDivisionError'):
            ip.run_cell('foo.f()')
        with open(fname, 'w') as f:
            f.write(file_2)
        with tt.AssertNotPrints('Internal    Python    error', channel='stderr'):
            with tt.AssertPrints('ZeroDivisionError'):
                ip.run_cell('foo.f()')
            with tt.AssertPrints('ZeroDivisionError'):
                ip.run_cell('foo.f()')
