| 14 | class AtomicFileTest(unittest.TestCase): |
| 15 | |
| 16 | def setUp(self): |
| 17 | # Ignore pylint because we perform a tear down and assert the temporary |
| 18 | # files are gone. |
| 19 | # pylint: disable=consider-using-with |
| 20 | self.destination_dir = tempfile.TemporaryDirectory() |
| 21 | |
| 22 | self.temp_dir = tempfile.TemporaryDirectory() |
| 23 | intermediate_files_path_patch = mock.patch.object( |
| 24 | atomic_file, '_TEMP_FOLDER', self.temp_dir.name) |
| 25 | self.addCleanup(intermediate_files_path_patch.stop) |
| 26 | intermediate_files_path_patch.start() |
| 27 | |
| 28 | def tearDown(self): |
| 29 | self.destination_dir.cleanup() |