(self)
| 1713 | |
| 1714 | @skip_if_dont_write_bytecode |
| 1715 | def test_missing_source_legacy(self): |
| 1716 | # Like test_missing_source() except that for backward compatibility, |
| 1717 | # when the pyc file lives where the py file would have been (and named |
| 1718 | # without the tag), it is importable. The __file__ of the imported |
| 1719 | # module is the pyc location. |
| 1720 | __import__(TESTFN) |
| 1721 | # pyc_file gets removed in _clean() via tearDown(). |
| 1722 | pyc_file = make_legacy_pyc(self.source) |
| 1723 | os.remove(self.source) |
| 1724 | unload(TESTFN) |
| 1725 | importlib.invalidate_caches() |
| 1726 | m = __import__(TESTFN) |
| 1727 | try: |
| 1728 | self.assertEqual(m.__file__, |
| 1729 | os.path.join(os.getcwd(), os.path.relpath(pyc_file))) |
| 1730 | finally: |
| 1731 | os.remove(pyc_file) |
| 1732 | |
| 1733 | def test_recompute_pyc_same_second(self): |
| 1734 | # Even when the source file doesn't change timestamp, a change in |
nothing calls this directly
no test coverage detected