Visitar URL original
[3.13] gh-157579: Fix race condition in the cleanup of `tempfile.TemporaryDirectory` (GH-157580) by miss-islington · Pull Request #158429 · python/cpython · GitHub
Skip to content
Open
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
Add root user checks to test.support
This partially backports commit 86b8617
(GH-146195); making existing tests use the helper is omitted.
  • Loading branch information
encukou committed Sep 30, 2026
commit 8da0b0a4493476e974836a31bac3d0bc3f19f250
5 changes: 5 additions & 0 deletions Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"force_not_colorized_test_class",
"make_clean_env",
"BrokenIter",
"requires_root_user", "requires_non_root_user",
]


Expand Down Expand Up @@ -2921,3 +2922,7 @@ def skip_on_low_desktop_heap_memory_subprocess(returncode):
if returncode == STATUS_DLL_INIT_FAILED:
raise unittest.SkipTest('gh-150436: DLL init failed, likely because '
'of low desktop heap memory')

_ROOT_IN_POSIX = hasattr(os, 'geteuid') and os.geteuid() == 0
requires_root_user = unittest.skipUnless(_ROOT_IN_POSIX, "test needs root privilege")
requires_non_root_user = unittest.skipIf(_ROOT_IN_POSIX, "test needs non-root account")
Loading