nate nowack commited on
Commit
7b7ee7e
·
unverified ·
2 Parent(s): e18286f441ce03

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

Browse files
tests/resources/test_file_resources.py CHANGED
@@ -99,7 +99,8 @@ class TestFileResource:
99
  await resource.read()
100
 
101
  @pytest.mark.skipif(
102
- os.name == "nt", reason="File permissions behave differently on Windows"
 
103
  )
104
  async def test_permission_error(self, temp_file: Path):
105
  """Test reading a file without permissions."""
 
99
  await resource.read()
100
 
101
  @pytest.mark.skipif(
102
+ os.name == "nt" or (hasattr(os, "getuid") and os.getuid() == 0),
103
+ reason="File permissions behave differently on Windows or when running as root",
104
  )
105
  async def test_permission_error(self, temp_file: Path):
106
  """Test reading a file without permissions."""