Fail if test dir doesn't exist (#2233)

This commit is contained in:
Ayaz Salikhov
2025-02-21 18:58:30 +00:00
committed by GitHub
parent ba19c03837
commit 73628de2cd

View File

@@ -9,7 +9,7 @@ assert IMAGE_SPECIFIC_TESTS_DIR.exists(), f"{IMAGE_SPECIFIC_TESTS_DIR} does not
# Please, take a look at the hierarchy of the images here: # Please, take a look at the hierarchy of the images here:
# https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#image-relationships # https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#image-relationships
ALL_IMAGES = { _IMAGE_PARENT = {
"docker-stacks-foundation": None, "docker-stacks-foundation": None,
"base-notebook": "docker-stacks-foundation", "base-notebook": "docker-stacks-foundation",
"minimal-notebook": "base-notebook", "minimal-notebook": "base-notebook",
@@ -30,9 +30,8 @@ def get_test_dirs(
if short_image_name is None: if short_image_name is None:
return [] return []
test_dirs = get_test_dirs(ALL_IMAGES[short_image_name]) test_dirs = get_test_dirs(_IMAGE_PARENT[short_image_name])
if ( current_test_dir = IMAGE_SPECIFIC_TESTS_DIR / short_image_name
current_image_tests_dir := IMAGE_SPECIFIC_TESTS_DIR / short_image_name assert current_test_dir.exists(), f"{current_test_dir} does not exist."
).exists(): test_dirs.append(current_test_dir)
test_dirs.append(current_image_tests_dir)
return test_dirs return test_dirs