Skip to content

Commit d51bda2

Browse files
committed
Skip tests that will always fail if run as root
1 parent 77b3bf8 commit d51bda2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/config/tests.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,10 @@ def test_file_is_readable_validator_not_a_file(tmpdir):
278278
assert "is not a file" in e.value.args[0]
279279

280280

281-
@pytest.mark.skipif(platform.system() == "Windows", reason="os.access() doesn't seem to work as we expect on Windows")
281+
@pytest.mark.skipif(
282+
platform.system() == "Windows" or os.getuid() == 0,
283+
reason="os.access() doesn't seem to work as we expect on Windows and test will fail as root user",
284+
)
282285
def test_file_is_readable_validator_not_readable(tmpdir):
283286
p = tmpdir.join("nonreadable")
284287
p.write("")

0 commit comments

Comments
 (0)