1 diff --git a/setup.py b/setup.py
2 index 072dfc8..64732bb 100644
5 @@ -39,7 +39,7 @@ _apple_devices = ('appletv', 'iphone', 'ipod', 'ipad', 'watch')
6 is_macos = sys.platform == 'darwin' and not machine().lower().startswith(_apple_devices)
9 -if is_macos or os.getenv('FORCE_MACOS_MACHINE', '0') == '1':
13 name='_watchdog_fsevents',
14 diff --git a/tests/test_emitter.py b/tests/test_emitter.py
15 index bec052c..242fbea 100644
16 --- a/tests/test_emitter.py
17 +++ b/tests/test_emitter.py
18 @@ -42,13 +42,11 @@ if platform.is_linux():
19 InotifyEmitter as Emitter,
22 -elif platform.is_darwin():
23 - from watchdog.observers.fsevents import FSEventsEmitter as Emitter
24 elif platform.is_windows():
25 from watchdog.observers.read_directory_changes import (
26 WindowsApiEmitter as Emitter
28 -elif platform.is_bsd():
29 +elif platform.is_bsd() or platform.is_darwin():
30 from watchdog.observers.kqueue import (
31 KqueueEmitter as Emitter
33 @@ -57,12 +55,6 @@ logging.basicConfig(level=logging.DEBUG)
34 logger = logging.getLogger(__name__)
37 -if platform.is_darwin():
38 - # enable more verbose logs
39 - fsevents_logger = logging.getLogger("fsevents")
40 - fsevents_logger.setLevel(logging.DEBUG)
43 @pytest.fixture(autouse=True)
44 def setup_teardown(tmpdir):
45 global p, emitter, event_queue
46 @@ -85,9 +77,6 @@ def start_watching(path=None, use_full_emitter=False, recursive=True):
48 emitter = Emitter(event_queue, ObservedWatch(path, recursive=recursive))
50 - if platform.is_darwin():
51 - emitter.suppress_history = True
56 @@ -345,7 +334,7 @@ def test_separate_consecutive_moves():
57 if platform.is_windows():
58 expected_events = [a_deleted, d_created]
60 - if platform.is_bsd():
61 + if platform.is_bsd() or platform.is_darwin():
62 # Due to the way kqueue works, we can't really order
63 # 'Created' and 'Deleted' events in time, so creation queues first
64 expected_events = [d_created, a_deleted, dir_modif, dir_modif]
65 @@ -355,7 +344,7 @@ def test_separate_consecutive_moves():
68 @pytest.mark.flaky(max_runs=5, min_passes=1, rerun_filter=rerun_filter)
69 -@pytest.mark.skipif(platform.is_bsd(), reason="BSD create another set of events for this test")
70 +@pytest.mark.skipif(platform.is_bsd() or platform.is_darwin(), reason="BSD create another set of events for this test")
71 def test_delete_self():
73 start_watching(p('dir1'))
74 @@ -365,7 +354,7 @@ def test_delete_self():
75 assert not emitter.is_alive()
78 -@pytest.mark.skipif(platform.is_windows() or platform.is_bsd(),
79 +@pytest.mark.skipif(platform.is_windows() or platform.is_bsd() or platform.is_darwin(),
80 reason="Windows|BSD create another set of events for this test")
81 def test_fast_subdirectory_creation_deletion():
83 @@ -429,7 +418,7 @@ def test_recursive_on():
84 assert event.src_path == p('dir1', 'dir2', 'dir3')
85 assert isinstance(event, DirModifiedEvent)
87 - if not platform.is_bsd():
88 + if not (platform.is_bsd() or platform.is_darwin()):
89 event = event_queue.get(timeout=5)[0]
90 assert event.src_path == p('dir1', 'dir2', 'dir3', 'a')
91 assert isinstance(event, FileModifiedEvent)
92 @@ -452,26 +441,6 @@ def test_recursive_off():
93 if platform.is_linux():
94 expect_event(FileClosedEvent(p('b')))
96 - # currently limiting these additional events to macOS only, see https://github.com/gorakhargosh/watchdog/pull/779
97 - if platform.is_darwin():
98 - mkdir(p('dir1', 'dir2'))
99 - with pytest.raises(Empty):
100 - event_queue.get(timeout=5)
101 - mkfile(p('dir1', 'dir2', 'somefile'))
102 - with pytest.raises(Empty):
103 - event_queue.get(timeout=5)
106 - expect_event(DirModifiedEvent(p())) # the contents of the parent directory changed
108 - mv(p('dir1', 'dir2', 'somefile'), p('somefile'))
109 - expect_event(FileMovedEvent(p('dir1', 'dir2', 'somefile'), p('somefile')))
110 - expect_event(DirModifiedEvent(p()))
112 - mv(p('dir1', 'dir2'), p('dir2'))
113 - expect_event(DirMovedEvent(p('dir1', 'dir2'), p('dir2')))
114 - expect_event(DirModifiedEvent(p()))
117 @pytest.mark.skipif(platform.is_windows(),
118 reason="Windows create another set of events for this test")
119 @@ -493,7 +462,7 @@ def test_renaming_top_level_directory():
121 expect_event(DirMovedEvent(p('a', 'b'), p('a2', 'b')))
123 - if platform.is_bsd():
124 + if platform.is_bsd() or platform.is_darwin():
125 expect_event(DirModifiedEvent(p()))
127 open(p('a2', 'b', 'c'), 'a').close()
128 @@ -584,7 +553,7 @@ def test_move_nested_subdirectories():
129 expect_event(DirMovedEvent(p('dir1', 'dir2', 'dir3'), p('dir2', 'dir3')))
130 expect_event(FileMovedEvent(p('dir1', 'dir2', 'dir3', 'a'), p('dir2', 'dir3', 'a')))
132 - if platform.is_bsd():
133 + if platform.is_bsd() or platform.is_darwin():
134 event = event_queue.get(timeout=5)[0]
135 assert p(event.src_path) == p()
136 assert isinstance(event, DirModifiedEvent)
137 @@ -643,7 +612,7 @@ def test_move_nested_subdirectories_on_windows():
140 @pytest.mark.flaky(max_runs=5, min_passes=1, rerun_filter=rerun_filter)
141 -@pytest.mark.skipif(platform.is_bsd(), reason="BSD create another set of events for this test")
142 +@pytest.mark.skipif(platform.is_bsd() or platform.is_darwin(), reason="BSD create another set of events for this test")
143 def test_file_lifecyle():
146 diff --git a/tests/test_fsevents.py b/tests/test_fsevents.py
147 index 4a4fabf..49886a1 100644
148 --- a/tests/test_fsevents.py
149 +++ b/tests/test_fsevents.py
152 from watchdog.utils import platform
154 -if not platform.is_darwin(): # noqa
155 - pytest.skip("macOS only.", allow_module_level=True)
156 +pytest.skip("doesn't work with Nix yet", allow_module_level=True)