8000 gh-108962: Skip test_tempfile.test_flags() if not supported by vstinner · Pull Request #108964 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-108962: Skip test_tempfile.test_flags() if not supported #108964

New issue

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

Merged
merged 3 commits into from
Sep 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix typo
  • Loading branch information
vstinner committed Sep 5, 2023
commit 2c2dbbf91c26cac57c17a76d666a60972feade61
6 changes: 3 additions & 3 deletions Lib/test/test_tempfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1834,12 +1834,12 @@ def test_modes(self):
d.cleanup()
self.assertFalse(os.path.exists(d.name))

@unittest.skipUnless(hasattr(os, 'chflags'), 'requires os.lchflags')
@unittest.skipUnless(hasattr(os, 'chflags'), 'requires os.chflags')
def test_flags(self):
flags = stat.UF_IMMUTABLE | stat.UF_NOUNLINK

# skip the test if these flags are not supported (ex: FreeBSD 13)
filename = TESTFN
filename = os_helper.TESTFN
try:
open(filename, "w").close()
try:
Expand All @@ -1849,7 +1849,7 @@ def test_flags(self):
self.skipTest("chflags() doesn't support "
"UF_IMMUTABLE|UF_NOUNLINK: {exc}")
finally:
support.unlink(filename)
os_helper.unlink(filename)

d = self.do_create(recurse=3, dirs=2, files=2)
with d:
Expand Down
0