diff --git a/tests/test_config.py b/tests/test_config.py index a3d7219a..4a677d28 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -703,9 +703,10 @@ def test_config_precedence(): assert cfg(f=LOCAL)['pytest']['precedence'] == 'local' +@pytest.mark.skipif(WINDOWS, reason="Non-readable files do not exist on Windows") @pytest.mark.skipif( - WINDOWS or (os.geteuid() == 0), - reason="Non-readable files do not exist on Windows, and root user can always read files", + hasattr(os, "geteuid") and os.geteuid() == 0, + reason="root user can always read files", ) def test_config_non_readable_file(config_tmpdir): # test to read a config file without read permission