From 7b9c8ad144d308d18279190ca23b3c76a3843c42 Mon Sep 17 00:00:00 2001 From: Kai Knoblich <43905002+knobix@users.noreply.github.com> Date: Sat, 18 Sep 2021 14:01:27 +0200 Subject: [PATCH 1/3] Restore previous behavior of "absolute_path()" The function `absolute_path` that was provided by "pathtools" was redefined and now gives a "Path" object back as return value. However, this leads to assertion errors when executing the test suite on FreeBSD, because there are now discrepancies between "PosixPath('/some/dir')" and "'/some/dir'". Thus restore the original return value of "absolute_path" as is was done by "pathtools". See also: https://pythonhosted.org/pathtools/_modules/pathtools/path.html#absolute_path --- src/watchdog/observers/kqueue.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/watchdog/observers/kqueue.py b/src/watchdog/observers/kqueue.py index bd1f55e1..c70c94f1 100644 --- a/src/watchdog/observers/kqueue.py +++ b/src/watchdog/observers/kqueue.py @@ -76,8 +76,6 @@ import os.path import select -from pathlib import Path - from watchdog.observers.api import ( BaseObserver, EventEmitter, @@ -127,7 +125,7 @@ def absolute_path(path): - return Path(path).resolve() + return os.path.abspath(os.path.normpath(path)) # Flag tests. From 900477fe7f476f94bb3c2c44c22439926deeae72 Mon Sep 17 00:00:00 2001 From: Kai Knoblich <43905002+knobix@users.noreply.github.com> Date: Sat, 18 Sep 2021 14:05:01 +0200 Subject: [PATCH 2/3] Skip two checks for BSD * Test "test_delete_self()" was tested only on Darwin platforms with release 0.10.6 * Test "file_lifecyle" was introduced in the 2.0.0 release --- tests/test_emitter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_emitter.py b/tests/test_emitter.py index d7e19b36..bec052c8 100644 --- a/tests/test_emitter.py +++ b/tests/test_emitter.py @@ -355,6 +355,7 @@ def test_separate_consecutive_moves(): @pytest.mark.flaky(max_runs=5, min_passes=1, rerun_filter=rerun_filter) +@pytest.mark.skipif(platform.is_bsd(), reason="BSD create another set of events for this test") def test_delete_self(): mkdir(p('dir1')) start_watching(p('dir1')) @@ -642,6 +643,7 @@ def test_move_nested_subdirectories_on_windows(): @pytest.mark.flaky(max_runs=5, min_passes=1, rerun_filter=rerun_filter) +@pytest.mark.skipif(platform.is_bsd(), reason="BSD create another set of events for this test") def test_file_lifecyle(): start_watching() From 4cc2617cc4ded6dbad27c5d136662684d6c5defa Mon Sep 17 00:00:00 2001 From: Kai Knoblich <43905002+knobix@users.noreply.github.com> Date: Sat, 18 Sep 2021 14:50:09 +0200 Subject: [PATCH 3/3] Update changelog for (#841) and (#842) --- changelog.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/changelog.rst b/changelog.rst index ff918c34..057d57db 100644 --- a/changelog.rst +++ b/changelog.rst @@ -8,8 +8,9 @@ Changelog 2021-xx-xx • `full history `__ -- -- Thanks to our beloved contributors: @ +- [bsd] Fixed returned paths in ``kqueue.py`` and restored the overall results of the test suite (`#842 `_) +- [bsd] Updated FreeBSD CI support (`#841 `_) +- Thanks to our beloved contributors: @knobix 2.1.5 ~~~~~