gh-135386: Skip readonly tests for the root user (GH-138058)

This commit is contained in:
Serhiy Storchaka 2025-08-22 16:22:14 +03:00 committed by GitHub
parent 8952b826a7
commit 5b0f00e616
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,6 +16,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):
@ -92,6 +97,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):