From: Serhiy Storchaka Date: Fri, 22 Aug 2025 13:22:14 +0000 (+0300) Subject: gh-135386: Skip readonly tests for the root user (GH-138058) X-Git-Tag: v3.15.0a1~611 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5b0f00e616738ededcf4b178dee8c30f5005e7ae;p=thirdparty%2FPython%2Fcpython.git gh-135386: Skip readonly tests for the root user (GH-138058) --- diff --git a/Lib/test/test_dbm_sqlite3.py b/Lib/test/test_dbm_sqlite3.py index 15826f51c541..f367a98865d4 100644 --- a/Lib/test/test_dbm_sqlite3.py +++ b/Lib/test/test_dbm_sqlite3.py @@ -16,6 +16,11 @@ import sqlite3 from dbm.sqlite3 import _normalize_uri +root_in_posix = False +if hasattr(os, 'geteuid'): + root_in_posix = (os.geteuid() == 0) + + class _SQLiteDbmTests(unittest.TestCase): def setUp(self): @@ -92,6 +97,7 @@ class ReadOnly(_SQLiteDbmTests): self.assertEqual([k for k in self.db], [b"key1", b"key2"]) +@unittest.skipIf(root_in_posix, "test is meanless with root privilege") class ReadOnlyFilesystem(unittest.TestCase): def setUp(self):