[3.13] gh-135386: Skip readonly tests for the root user (GH-138058) (GH-138064)

(cherry picked from commit 5b0f00e616)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-08-22 15:44:19 +02:00 committed by GitHub
parent ebccd1de88
commit ab8ffc482e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,6 +17,11 @@
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 @@ def test_readonly_iter(self):
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):