(self)
| 446 | |
| 447 | # Test a file |
| 448 | def test_iter_file(self): |
| 449 | f = open(TESTFN, "w", encoding="utf-8") |
| 450 | try: |
| 451 | for i in range(5): |
| 452 | f.write("%d\n" % i) |
| 453 | finally: |
| 454 | f.close() |
| 455 | f = open(TESTFN, "r", encoding="utf-8") |
| 456 | try: |
| 457 | self.check_for_loop(f, ["0\n", "1\n", "2\n", "3\n", "4\n"], pickle=False) |
| 458 | self.check_for_loop(f, [], pickle=False) |
| 459 | finally: |
| 460 | f.close() |
| 461 | try: |
| 462 | unlink(TESTFN) |
| 463 | except OSError: |
| 464 | pass |
| 465 | |
| 466 | # Test list()'s use of iterators. |
| 467 | def test_builtin_list(self): |
nothing calls this directly
no test coverage detected