From 4107b268ce45ff118c08645edab69eb48f691f73 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 6 Dec 2013 23:15:21 +0000 Subject: [PATCH] [ck2cti/Test] Eliminate confusing messages from expected errors Suppress error messages from tests of ck2cti that use bad input to test that input validation is working correctly. --- interfaces/python/ck2cti.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/interfaces/python/ck2cti.py b/interfaces/python/ck2cti.py index 5c0e396ef..62f84ebfd 100755 --- a/interfaces/python/ck2cti.py +++ b/interfaces/python/ck2cti.py @@ -1558,7 +1558,7 @@ class Parser(object): try: reaction,revReaction = self.readKineticsEntry(kinetics) except Exception as e: - print('Error reading reaction entry starting on line {0}:'.format(line_number)) + logging.error('Error reading reaction entry starting on line {0}:'.format(line_number)) raise reaction.line_number = line_number self.reactions.append(reaction) @@ -1755,6 +1755,8 @@ duplicate transport data) to be ignored. outName=None, quiet=False, permissive=None): if quiet: logging.basicConfig(level=logging.ERROR) + else: + logging.basicConfig(level=logging.INFO) if permissive is not None: self.warning_as_error = not permissive @@ -1763,16 +1765,16 @@ duplicate transport data) to be ignored. # Read input mechanism files self.loadChemkinFile(inputFile) except Exception: - print("\nERROR: Unable to parse '{0}' near line {1}:\n".format( - inputFile, self.line_number)) + logging.warning("\nERROR: Unable to parse '{0}' near line {1}:\n".format( + inputFile, self.line_number)) raise if thermoFile: try: self.loadChemkinFile(thermoFile) except Exception: - print("\nERROR: Unable to parse '{0}' near line {1}:\n".format( - thermoFile, self.line_number)) + logging.warning("\nERROR: Unable to parse '{0}' near line {1}:\n".format( + thermoFile, self.line_number)) raise if transportFile: