Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@pytest.mark.skipif(WINDOWS, reason="Non-readable files do not exist on Windows")
@pytest.mark.skipif(WINDOWS, reason="chmod is not available on Windows")

Pretty sure NTFS can stop some users from reading some files!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is available, but you can only make files read-only.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marc-hb do you still prefer that I change to your suggestion? I'm fine either way.

@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
Expand Down