Amerr, Ziad (ext) (DI SW ICS MNA RD QA QST 2) commited on
Commit
24a616d
·
1 Parent(s): e18286f

Skipping permission test error if the user has root privileges

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 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."""