From 3a604d784c929a9dd01eb4dc65519ea53de0df9f Mon Sep 17 00:00:00 2001 From: Tristan van Berkom Date: Sun, 25 Oct 2020 19:11:25 +0900 Subject: tests/internals/utils_move_atomic.py: Conditionally skip a test Skip the mtime related test if the underlying filesystem does not support subsecond precision mtime. --- tests/internals/utils_move_atomic.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/internals/utils_move_atomic.py b/tests/internals/utils_move_atomic.py index dd417cb66..f78ac67fc 100644 --- a/tests/internals/utils_move_atomic.py +++ b/tests/internals/utils_move_atomic.py @@ -10,6 +10,7 @@ from buildstream.utils import ( _set_file_mtime, _parse_timestamp, ) +from buildstream.testing._utils.site import have_subsecond_mtime @pytest.fixture @@ -98,6 +99,12 @@ def test_move_to_existing_non_empty_dir(src, tmp_path): def test_move_to_empty_dir_set_mtime(src, tmp_path): + + # Skip this test if we do not have support for subsecond precision mtimes + # + if not have_subsecond_mtime(str(tmp_path)): + pytest.skip("Filesystem does not support subsecond mtime precision: {}".format(str(tmp_path))) + dst = tmp_path.joinpath("dst") move_atomic(src, dst) assert dst.joinpath("test").exists() -- cgit v1.2.1