Skip to content

Commit 27aa9df

Browse files
authored
Merge pull request #4928 from billsacks/revert_unnecessary_warning_removal
Revert "Merge pull request #4913 from jedwards4b/fix/python_warning" This reverts commit 991e19b, reversing changes made to e752d03. This reverts the changes in #4913 This is no longer needed given #4927
2 parents 4776faa + fc2de6d commit 27aa9df

2 files changed

Lines changed: 21 additions & 69 deletions

File tree

CIME/tests/test_sys_cime_case.py

Lines changed: 17 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,9 @@ def test_cime_case(self):
4545
)
4646

4747
case.flush()
48-
# the strip().splitlines()[-1] avoids a potential warning message in the output.
49-
build_complete = (
50-
utils.run_cmd_no_fail(
51-
"./xmlquery BUILD_COMPLETE --value", from_dir=casedir
52-
)
53-
.strip()
54-
.splitlines()[-1]
48+
49+
build_complete = utils.run_cmd_no_fail(
50+
"./xmlquery BUILD_COMPLETE --value", from_dir=casedir
5551
)
5652
self.assertEqual(
5753
build_complete,
@@ -346,26 +342,16 @@ def test_cime_case_xmlchange_append(self):
346342
self.run_cmd_assert_result(
347343
"./xmlchange --id PIO_CONFIG_OPTS --val='-opt1'", from_dir=casedir
348344
)
349-
# Avoids a potential warning in output about python version
350-
result = (
351-
self.run_cmd_assert_result(
352-
"./xmlquery --value PIO_CONFIG_OPTS", from_dir=casedir
353-
)
354-
.strip()
355-
.splitlines()[-1]
345+
result = self.run_cmd_assert_result(
346+
"./xmlquery --value PIO_CONFIG_OPTS", from_dir=casedir
356347
)
357348
self.assertEqual(result, "-opt1")
358349

359350
self.run_cmd_assert_result(
360351
"./xmlchange --id PIO_CONFIG_OPTS --val='-opt2' --append", from_dir=casedir
361352
)
362-
# the strip().splitlines()[-1] avoids a potential warning message in the output.
363-
result = (
364-
self.run_cmd_assert_result(
365-
"./xmlquery --value PIO_CONFIG_OPTS", from_dir=casedir
366-
)
367-
.strip()
368-
.splitlines()[-1]
353+
result = self.run_cmd_assert_result(
354+
"./xmlquery --value PIO_CONFIG_OPTS", from_dir=casedir
369355
)
370356
self.assertEqual(result, "-opt1 -opt2")
371357

@@ -519,14 +505,10 @@ def test_cime_case_test_walltime_mgmt_6(self):
519505
)
520506

521507
self.run_cmd_assert_result("./case.setup --reset", from_dir=casedir)
522-
# the strip().splitlines()[-1] avoids a potential warning message in the output.
523-
result = (
524-
self.run_cmd_assert_result(
525-
"./xmlquery JOB_WALLCLOCK_TIME --subgroup=case.test --value",
526-
from_dir=casedir,
527-
)
528-
.strip()
529-
.splitlines()[-1]
508+
509+
result = self.run_cmd_assert_result(
510+
"./xmlquery JOB_WALLCLOCK_TIME --subgroup=case.test --value",
511+
from_dir=casedir,
530512
)
531513
with Case(casedir) as case:
532514
walltime_format = case.get_value("walltime_format", subgroup=None)
@@ -553,14 +535,9 @@ def test_cime_case_test_walltime_mgmt_7(self):
553535

554536
self.run_cmd_assert_result("./case.setup --reset", from_dir=casedir)
555537

556-
# the strip().splitlines()[-1] avoids a potential warning message in the output.
557-
result = (
558-
self.run_cmd_assert_result(
559-
"./xmlquery JOB_WALLCLOCK_TIME --subgroup=case.test --value",
560-
from_dir=casedir,
561-
)
562-
.strip()
563-
.splitlines()[-1]
538+
result = self.run_cmd_assert_result(
539+
"./xmlquery JOB_WALLCLOCK_TIME --subgroup=case.test --value",
540+
from_dir=casedir,
564541
)
565542
with Case(casedir) as case:
566543
walltime_format = case.get_value("walltime_format", subgroup=None)
@@ -620,16 +597,10 @@ def test_cime_case_test_custom_project(self):
620597
env_changes="unset CIME_GLOBAL_WALLTIME &&",
621598
)
622599

623-
# the strip().splitlines()[-1] avoids a potential warning message in the output.
624-
result = (
625-
self.run_cmd_assert_result(
626-
"./xmlquery --non-local --value PROJECT --subgroup=case.test",
627-
from_dir=casedir,
628-
)
629-
.strip()
630-
.splitlines()[-1]
600+
result = self.run_cmd_assert_result(
601+
"./xmlquery --non-local --value PROJECT --subgroup=case.test",
602+
from_dir=casedir,
631603
)
632-
633604
self.assertEqual(result, "testproj")
634605

635606
def test_create_test_longname(self):

CIME/tests/test_sys_create_newcase.py

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,7 @@ def test_e_xmlquery(self):
314314
COMP_CLASSES = case.get_values("COMP_CLASSES")
315315
BUILD_COMPLETE = case.get_value("BUILD_COMPLETE")
316316
cmd = xmlquery + " --non-local STOP_N --value"
317-
# avoid a potential warning in output by only looking at the last line
318-
output = (
319-
utils.run_cmd_no_fail(cmd, from_dir=casedir).strip().splitlines()[-1]
320-
)
317+
output = utils.run_cmd_no_fail(cmd, from_dir=casedir)
321318
self.assertTrue(output == str(STOP_N), msg="%s != %s" % (output, STOP_N))
322319
cmd = xmlquery + " --non-local BUILD_COMPLETE --value"
323320
output = utils.run_cmd_no_fail(cmd, from_dir=casedir)
@@ -339,35 +336,19 @@ def test_e_xmlquery(self):
339336
for comp in COMP_CLASSES:
340337
caseresult = case.get_value("NTASKS_%s" % comp)
341338
cmd = xmlquery + " --non-local NTASKS_%s --value" % comp
342-
# avoid a potential warning in output by only looking at the last line
343-
output = (
344-
utils.run_cmd_no_fail(cmd, from_dir=casedir)
345-
.strip()
346-
.splitlines()[-1]
347-
)
348-
339+
output = utils.run_cmd_no_fail(cmd, from_dir=casedir)
349340
self.assertTrue(
350341
output == str(caseresult), msg="%s != %s" % (output, caseresult)
351342
)
352343
cmd = xmlquery + " --non-local NTASKS --subgroup %s --value" % comp
353-
# avoid a potential warning in output by only looking at the last line
354-
output = (
355-
utils.run_cmd_no_fail(cmd, from_dir=casedir)
356-
.strip()
357-
.splitlines()[-1]
358-
)
344+
output = utils.run_cmd_no_fail(cmd, from_dir=casedir)
359345
self.assertTrue(
360346
output == str(caseresult), msg="%s != %s" % (output, caseresult)
361347
)
362348
if self.MACHINE.has_batch_system():
363349
JOB_QUEUE = case.get_value("JOB_QUEUE", subgroup="case.run")
364350
cmd = xmlquery + " --non-local JOB_QUEUE --subgroup case.run --value"
365-
# avoid a potential warning in output by only looking at the last line
366-
output = (
367-
utils.run_cmd_no_fail(cmd, from_dir=casedir)
368-
.strip()
369-
.splitlines()[-1]
370-
)
351+
output = utils.run_cmd_no_fail(cmd, from_dir=casedir)
371352
self.assertTrue(
372353
output == JOB_QUEUE, msg="%s != %s" % (output, JOB_QUEUE)
373354
)

0 commit comments

Comments
 (0)