diff --git a/changelog.rst b/changelog.rst index 1cba95b75..fd3edd237 100644 --- a/changelog.rst +++ b/changelog.rst @@ -11,7 +11,8 @@ Changelog - Fixed the ``build_ext`` command on macOS Catalina (`#628 `__) - Refactored ``dispatch()`` method of ``FileSystemEventHandler``, ``PatternMatchingEventHandler`` and ``RegexMatchingEventHandler`` -- Thanks to our beloved contributors: @BoboTiG +- Improve tests support on non Windows/Linux platforms (`#633 `__) +- Thanks to our beloved contributors: @BoboTiG, @evilham 0.10.1 diff --git a/tests/test_emitter.py b/tests/test_emitter.py index 9f96daecc..90b1bf082 100644 --- a/tests/test_emitter.py +++ b/tests/test_emitter.py @@ -48,6 +48,10 @@ from watchdog.observers.read_directory_changes import ( WindowsApiEmitter as Emitter ) +elif platform.is_bsd(): + from watchdog.observers.kqueue import ( + KqueueEmitter as Emitter + ) logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger(__name__) @@ -177,7 +181,7 @@ def test_move_to(): assert isinstance(event, DirModifiedEvent) -@pytest.mark.skipif(platform.is_windows(), reason="InotifyFullEmitter not supported by Windows") +@pytest.mark.skipif(not platform.is_linux(), reason="InotifyFullEmitter only supported in Linux") def test_move_to_full(): mkdir(p('dir1')) mkdir(p('dir2')) @@ -209,7 +213,7 @@ def test_move_from(): assert isinstance(event, DirModifiedEvent) -@pytest.mark.skipif(platform.is_windows(), reason="InotifyFullEmitter not supported by Windows") +@pytest.mark.skipif(not platform.is_linux(), reason="InotifyFullEmitter only supported in Linux") def test_move_from_full(): mkdir(p('dir1')) mkdir(p('dir2')) @@ -398,8 +402,8 @@ def test_renaming_top_level_directory(): @pytest.mark.flaky(max_runs=5, min_passes=1, rerun_filter=rerun_filter) -@pytest.mark.skipif(platform.is_linux(), - reason="Linux create another set of events for this test") +@pytest.mark.skipif(not platform.is_windows(), + reason="Non-Windows create another set of events for this test") def test_renaming_top_level_directory_on_windows(): start_watching() @@ -485,8 +489,8 @@ def test_move_nested_subdirectories(): @pytest.mark.flaky(max_runs=5, min_passes=1, rerun_filter=rerun_filter) -@pytest.mark.skipif(platform.is_linux(), - reason="Linux create another set of events for this test") +@pytest.mark.skipif(not platform.is_windows(), + reason="Non-Windows create another set of events for this test") def test_move_nested_subdirectories_on_windows(): mkdir(p('dir1/dir2/dir3'), parents=True) touch(p('dir1/dir2/dir3', 'a'))