| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -957,6 +957,13 @@ def test_bad_mode(self): | |
| tempfile.NamedTemporaryFile(mode=2, dir=dir) | ||
| self.assertEqual(os.listdir(dir), []) | ||
|
|
||
| def test_if_temp_file_already_removed(self): | ||
| tmpdir = tempfile.mkdtemp() | ||
| self.addCleanup(support.rmtree, tmpdir) | ||
| with tempfile.NamedTemporaryFile(delete=True, dir=tmpdir) as fp: | ||
| os.system('rm {}'.format(fp.name)) | ||
|
Comment thread
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityWhy does this use os.system to call rm, rather than calling os.unlink? 'rm' is not exactly cross-platform. This test will also fail on Windows (and other systems where you can't delete files that are currently in use). It'll have to be skipped on those platforms.
Sorry, something went wrong.
serhiy-storchaka reacted with thumbs up emoji
All reactions
|
||
| self.assertEqual(os.listdir(tmpdir), []) | ||
|
|
||
| # How to test the mode and bufsize parameters? | ||
|
|
||
| class TestSpooledTemporaryFile(BaseTestCase): | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityShould add a self.addCleanup on that tmpdir—see the test above (test_bad_mode) for an example, just to make sure that if this test ever does fail that we don't have a temp dir that doesn't get cleaned up by us.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality@briancurtin right, thanks! fixed
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality@briancurtin could you please review it again, it's fixed now
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.