Skip to content

Commit ab8ffc4

Browse files
[3.13] gh-135386: Skip readonly tests for the root user (GH-138058) (GH-138064)
(cherry picked from commit 5b0f00e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent ebccd1d commit ab8ffc4

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
@@ -17,6 +17,11 @@
1717
from dbm.sqlite3 import _normalize_uri
1818

1919

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

2227
def setUp(self):
@@ -93,6 +98,7 @@ def test_readonly_iter(self):
9398
self.assertEqual([k for k in self.db], [b"key1", b"key2"])
9499

95100

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

98104
def setUp(self):

0 commit comments

Comments
 (0)