From 8468f520d8c9c8fe2b1323e098c49b4940374016 Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Wed, 14 Nov 2018 11:33:26 +0100 Subject: [PATCH] Reduce output from simple_cnf test to warnings --- test/test_simple_cnf.py | 11 +++-------- 1 files changed, 3 insertions(+), 8 deletions(-) diff --git a/test/test_simple_cnf.py b/test/test_simple_cnf.py index 49a77c3..4ad0486 100755 --- a/test/test_simple_cnf.py +++ b/test/test_simple_cnf.py @@ -109,10 +109,7 @@ def setUpModule(): ENCODING = sys.getfilesystemencoding() if ENCODING.lower() in ('ascii', 'ansi_x3.4-1968'): ENCODING = 'utf8' - print('Using fallback encoding {} for temp file creation' - .format(ENCODING)) - else: - print('Using filesystem encoding {} for temp file creation' + print('\nWARNING: Using fallback encoding {} for temp file creation' .format(ENCODING)) @@ -138,9 +135,8 @@ class SimpleCnfTest(unittest.TestCase): os.close(sys_file_descriptor) with open(cls.import_file, 'wb') as file_handle: file_handle.write(TEST_SET.encode(ENCODING)) - print('created temp file {0}'.format(cls.import_file)) except Exception: - print('exception creating temp file:') + print('\nWARNING: exception creating temp file:') print_exc() # clean up @@ -157,9 +153,8 @@ class SimpleCnfTest(unittest.TestCase): if cls.import_file is not None: try: os.unlink(cls.import_file) - print('deleted temp file {0}'.format(cls.import_file)) except Exception: - print('exception deleting temp file:') + print('\nWARNING: exception deleting temp file:') print_exc() # tests -- 1.7.1