diff options
author | Tristan van Berkom <tristan@codethink.co.uk> | 2020-10-25 19:11:25 +0900 |
---|---|---|
committer | Tristan van Berkom <tristan@codethink.co.uk> | 2020-10-25 19:11:25 +0900 |
commit | 3a604d784c929a9dd01eb4dc65519ea53de0df9f (patch) | |
tree | 2c537be1b225e41611693e335266870a7ac45546 /tests/internals | |
parent | f9ddbaaa4ae14d4c733dcc011ce6fcbb39f7607f (diff) | |
download | buildstream-3a604d784c929a9dd01eb4dc65519ea53de0df9f.tar.gz |
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.
Diffstat (limited to 'tests/internals')
-rw-r--r-- | tests/internals/utils_move_atomic.py | 7 |
1 files changed, 7 insertions, 0 deletions
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() |