| 277 | self.fname = fname |
| 278 | |
| 279 | def tearDown(self): |
| 280 | # If the tmpfile wasn't made because of skipped tests, like in |
| 281 | # win32, there's nothing to cleanup. |
| 282 | if hasattr(self, 'tmps'): |
| 283 | for fname in self.tmps: |
| 284 | # If the tmpfile wasn't made because of skipped tests, like in |
| 285 | # win32, there's nothing to cleanup. |
| 286 | try: |
| 287 | os.unlink(fname) |
| 288 | except: |
| 289 | # On Windows, even though we close the file, we still can't |
| 290 | # delete it. I have no clue why |
| 291 | pass |
| 292 | |
| 293 | def __enter__(self): |
| 294 | return self |