From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 22 Aug 2025 13:44:19 +0000 (+0200) Subject: [3.13] gh-135386: Skip readonly tests for the root user (GH-138058) (GH-138064) X-Git-Tag: v3.13.8~161 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ab8ffc482ecb08d125748a5e0b35b3f03a9371ea;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-135386: Skip readonly tests for the root user (GH-138058) (GH-138064) (cherry picked from commit 5b0f00e616738ededcf4b178dee8c30f5005e7ae) Co-authored-by: Serhiy Storchaka --- diff --git a/Lib/test/test_dbm_sqlite3.py b/Lib/test/test_dbm_sqlite3.py index ed846f946ec0..39eac7a35ec6 100644 --- a/Lib/test/test_dbm_sqlite3.py +++ b/Lib/test/test_dbm_sqlite3.py @@ -17,6 +17,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): @@ -93,6 +98,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):