| 733 | f.close() |
| 734 | |
| 735 | def test_setmtime(self): |
| 736 | import tempfile |
| 737 | |
| 738 | fd, name = tempfile.mkstemp() |
| 739 | os.close(fd) |
| 740 | try: |
| 741 | # Do not use _pytest.timing here, as we do not want time mocking to affect this test. |
| 742 | mtime = int(time.time()) - 100 |
| 743 | path = local(name) |
| 744 | assert path.mtime() != mtime |
| 745 | path.setmtime(mtime) |
| 746 | assert path.mtime() == mtime |
| 747 | path.setmtime() |
| 748 | assert path.mtime() != mtime |
| 749 | finally: |
| 750 | os.remove(name) |
| 751 | |
| 752 | def test_normpath(self, path1): |
| 753 | new1 = path1.join("/otherdir") |