From 2a2fd8f299967cabf6457804bf1666e7e9d23803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Sun, 11 Sep 2022 19:41:26 +0200 Subject: [PATCH] attempt making vr image test usable without a data dir setup --- yt/testing.py | 7 +++++++ .../volume_rendering/tests/test_mesh_render.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/yt/testing.py b/yt/testing.py index 2ee59eb42f6..a6c38636aff 100644 --- a/yt/testing.py +++ b/yt/testing.py @@ -958,6 +958,13 @@ def requires_file(req_file): return skipif(condition, reason=f"Missing required file {req_file}") +def requires_file_v2(req_file): + condition = not os.path.exists( + os.path.join(ytcfg.get("yt", "test_data_dir"), req_file) + ) + return skipif(condition, reason=f"Missing required file {req_file}") + + def disable_dataset_cache(func): @wraps(func) def newfunc(*args, **kwargs): diff --git a/yt/visualization/volume_rendering/tests/test_mesh_render.py b/yt/visualization/volume_rendering/tests/test_mesh_render.py index c758189091d..acc745650a7 100644 --- a/yt/visualization/volume_rendering/tests/test_mesh_render.py +++ b/yt/visualization/volume_rendering/tests/test_mesh_render.py @@ -5,7 +5,7 @@ from yt.testing import ( fake_hexahedral_ds, fake_tetrahedral_ds, - requires_file, + requires_file_v2 as requires_file, requires_module, ) from yt.utilities.answer_testing.framework import data_dir_load, data_dir_load_v2