Skip to content

Commit 5b0f00e

Browse files
gh-135386: Skip readonly tests for the root user (GH-138058)
1 parent 8952b82 commit 5b0f00e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Lib/test/test_dbm_sqlite3.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
from dbm.sqlite3 import _normalize_uri
1717

1818

19+
root_in_posix = False
20+
if hasattr(os, 'geteuid'):
21+
root_in_posix = (os.geteuid() == 0)
22+
23+
1924
class _SQLiteDbmTests(unittest.TestCase):
2025

2126
def setUp(self):
@@ -92,6 +97,7 @@ def test_readonly_iter(self):
9297
self.assertEqual([k for k in self.db], [b"key1", b"key2"])
9398

9499

100+
@unittest.skipIf(root_in_posix, "test is meanless with root privilege")
95101
class ReadOnlyFilesystem(unittest.TestCase):
96102

97103
def setUp(self):

0 commit comments

Comments
 (0)