Skip to content

Commit 3d9fbf6

Browse files
committed
Raise error if test_config does not exist, rather than using assert
1 parent 2ba48a9 commit 3d9fbf6

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

tests/qa/test_test_access_esm1p5_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ def test_test_access_esm1p5_config_release_release_preindustrial():
99
access_esm1p5_configs = RESOURCES_DIR / "access" / "configurations"
1010
test_config = access_esm1p5_configs / "release-preindustrial+concentrations"
1111

12-
assert test_config.exists()
12+
if not test_config.exists():
13+
raise FileNotFoundError(f"The test configuration {test_config} does not exist.")
1314

1415
test_cmd = (
1516
"model-config-tests -s "

tests/qa/test_test_access_esm1p6_config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ def test_test_access_esm1p6_config_release_release_preindustrial():
1111
# access_esm1p6_configs = RESOURCES_DIR / "access" / "configurations"
1212
# test_config = access_esm1p6_configs / "release-preindustrial+concentrations"
1313

14-
# assert test_config.exists()
14+
# if not test_config.exists():
15+
# raise FileNotFoundError(
16+
# f"The test configuration {test_config} does not exist."
17+
# )
1518

1619
# test_cmd = (
1720
# "model-config-tests -s "

tests/qa/test_test_access_om2_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ def test_test_access_om2_config_release_1deg_jra55_ryf():
1212
access_om2_configs = RESOURCES_DIR / "access-om2" / "configurations"
1313
test_config = access_om2_configs / "release-1deg_jra55_ryf"
1414

15-
assert test_config.exists()
15+
if not test_config.exists():
16+
raise FileNotFoundError(f"The test configuration {test_config} does not exist.")
1617

1718
test_cmd = (
1819
"model-config-tests -s "

tests/qa/test_test_access_om3_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ def test_test_access_om3_config_release_1deg_jra55_ryf():
1212
access_om3_configs = RESOURCES_DIR / "access-om3" / "configurations"
1313
test_config = access_om3_configs / "om3-dev-1deg_jra55do_ryf"
1414

15-
assert test_config.exists()
15+
if not test_config.exists():
16+
raise FileNotFoundError(f"The test configuration {test_config} does not exist.")
1617

1718
test_cmd = (
1819
"model-config-tests -s "

tests/qa/test_test_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ def test_test_config_access_om2():
1010
access_om2_configs = RESOURCES_DIR / "access-om2" / "configurations"
1111
test_config = access_om2_configs / branch_name
1212

13-
assert test_config.exists()
13+
if not test_config.exists():
14+
raise FileNotFoundError(f"The test configuration {test_config} does not exist.")
1415

1516
test_cmd = (
1617
"model-config-tests -s "

0 commit comments

Comments
 (0)