From 7bf2bb671dcce90bb5114a7812c860dd80d32c5a Mon Sep 17 00:00:00 2001 From: Sam Schott Date: Tue, 13 Jul 2021 11:46:06 +0100 Subject: [PATCH] change permissions in test to read-only --- tests/test_emitter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_emitter.py b/tests/test_emitter.py index 10f68fdf..9e48fa8f 100644 --- a/tests/test_emitter.py +++ b/tests/test_emitter.py @@ -15,6 +15,7 @@ # limitations under the License. import os +import stat import time import pytest import logging @@ -200,7 +201,9 @@ def test_chomod(): mkfile(p('a')) start_watching() - os.chmod(p('a'), 0o744) + # Note: We use S_IREAD here because chmod on Windows only + # allows setting the read-only flag. + os.chmod(p('a'), stat.S_IREAD) expect_event(FileModifiedEvent(p('a')))