Skip to content

Commit

Permalink
Reformat CIME/ with black.
Browse files Browse the repository at this point in the history
  • Loading branch information
samsrabin committed Jan 22, 2025
1 parent ff177e8 commit 6751504
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
12 changes: 9 additions & 3 deletions CIME/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,18 @@ def __init__(
elif skip_tests_with_existing_baselines:
tests_to_skip.append(test_name)
expect(
allow_baseline_overwrite or len(existing_baselines) == 0 or skip_tests_with_existing_baselines,
allow_baseline_overwrite
or len(existing_baselines) == 0
or skip_tests_with_existing_baselines,
"Baseline directories already exists {}\n"
"Use -o or --skip-tests-with-existing-baselines to avoid this error".format(existing_baselines),
"Use -o or --skip-tests-with-existing-baselines to avoid this error".format(
existing_baselines
),
)
if skip_tests_with_existing_baselines:
test_names = [test for test in test_names if test not in tests_to_skip]
test_names = [
test for test in test_names if test not in tests_to_skip
]

if self._config.sort_tests:
_order_tests_by_runtime(test_names, self._baseline_root)
Expand Down
5 changes: 4 additions & 1 deletion CIME/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,10 @@ def _create_test(
if expect_cases_made:
self.assertTrue(len(cases) > 0, "create_test made no cases")
else:
self.assertTrue(len(cases) == 0, "create_test unexpectedly made {} case(s)".format(len(cases)))
self.assertTrue(
len(cases) == 0,
"create_test unexpectedly made {} case(s)".format(len(cases)),
)

return cases[0] if len(cases) == 1 else cases

Expand Down
3 changes: 2 additions & 1 deletion CIME/tests/test_sys_cime_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,8 @@ def test_skip_run_with_existing_baseline(self):
)
self._testroot = os.path.join(orig_testroot, "case1")
casedir_1 = self._create_test(
["--output-root", "case1", "--skip-tests-with-existing-baselines"] + create_test_extra_args,
["--output-root", "case1", "--skip-tests-with-existing-baselines"]
+ create_test_extra_args,
test_id=self._baseline_name,
expect_cases_made=False,
)
Expand Down

0 comments on commit 6751504

Please sign in to comment.