def test_iter_file(self):
        f = open(TESTFN, "w")
        try:
            for i in range(5):
                f.write("%d\n" % i)
        finally:
            f.close()
        f = open(TESTFN, "r")
        try:
            self.check_for_loop(f, ["0\n", "1\n", "2\n", "3\n", "4\n"], pickle=False)
            self.check_for_loop(f, [], pickle=False)
        finally:
            f.close()
            try:
                unlink(TESTFN)
            except __HOLE__:
                pass

    # Test list()'s use of iterators.
dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/test/test_iter.py/TestCase.test_iter_file