Merge pull request #502 from ZiadAmerr/fix-test-permission-error

Skipping `test_permission_error` if runner is root.
This commit is contained in:
nate nowack 2025-05-19 12:41:31 -05:00 committed by GitHub
commit de708def3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -99,7 +99,8 @@ class TestFileResource:
await resource.read()
@pytest.mark.skipif(
os.name == "nt", reason="File permissions behave differently on Windows"
os.name == "nt" or (hasattr(os, "getuid") and os.getuid() == 0),
reason="File permissions behave differently on Windows or when running as root",
)
async def test_permission_error(self, temp_file: Path):
"""Test reading a file without permissions."""