]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-135386: Skip readonly tests for the root user (GH-138058) (GH-138064)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 22 Aug 2025 13:44:19 +0000 (15:44 +0200)
committerGitHub <noreply@github.com>
Fri, 22 Aug 2025 13:44:19 +0000 (13:44 +0000)
(cherry picked from commit 5b0f00e616738ededcf4b178dee8c30f5005e7ae)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/test/test_dbm_sqlite3.py

index ed846f946ec0b8250f51e263e2730be38f24d56e..39eac7a35ec6effc0add02ac0e86fc5aef8881cc 100644 (file)
@@ -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):