From e8af6201e15e28f39b058021cf3b77a634a25d04 Mon Sep 17 00:00:00 2001 From: Lee Miller Date: Wed, 27 Sep 2023 03:00:05 +0300 Subject: [PATCH] Fix the test for proofofwork.LogOutput() --- src/tests/test_log.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tests/test_log.py b/src/tests/test_log.py index e62010a0..4e74e50d 100644 --- a/src/tests/test_log.py +++ b/src/tests/test_log.py @@ -14,8 +14,8 @@ class TestLog(unittest.TestCase): sys.hexversion < 0x3000000, 'assertLogs is new in version 3.4') def test_LogOutput(self): """Use proofofwork.LogOutput to log output of a shell command""" - def echo(): - """Call the echo shell command""" - with proofofwork.LogOutput(): + with self.assertLogs('default') as cm: # pylint: disable=no-member + with proofofwork.LogOutput('+'): subprocess.call(['echo', 'HELLO']) - self.assertLogs(echo(), 'HELLO') # pylint: disable=no-member + + self.assertEqual(cm.output, ['INFO:default:+: HELLO\n'])