(self)
| 663 | |
| 664 | @skip_if_dont_write_bytecode |
| 665 | def test_timestamp_overflow(self): |
| 666 | # A modification timestamp larger than 2**32 should not be a problem |
| 667 | # when importing a module (issue #11235). |
| 668 | sys.path.insert(0, os.curdir) |
| 669 | try: |
| 670 | source = TESTFN + ".py" |
| 671 | compiled = importlib.util.cache_from_source(source) |
| 672 | with open(source, 'w', encoding='utf-8') as f: |
| 673 | pass |
| 674 | try: |
| 675 | os.utime(source, (2 ** 33 - 5, 2 ** 33 - 5)) |
| 676 | except OverflowError: |
| 677 | self.skipTest("cannot set modification time to large integer") |
| 678 | except OSError as e: |
| 679 | if e.errno not in (getattr(errno, 'EOVERFLOW', None), |
| 680 | getattr(errno, 'EINVAL', None)): |
| 681 | raise |
| 682 | self.skipTest("cannot set modification time to large integer ({})".format(e)) |
| 683 | __import__(TESTFN) |
| 684 | # The pyc file was created. |
| 685 | os.stat(compiled) |
| 686 | finally: |
| 687 | del sys.path[0] |
| 688 | remove_files(TESTFN) |
| 689 | |
| 690 | def test_bogus_fromlist(self): |
| 691 | try: |
nothing calls this directly
no test coverage detected