Fix the test for proofofwork.LogOutput()
This commit is contained in:
parent
b66dfcaebb
commit
e8af6201e1
|
@ -14,8 +14,8 @@ class TestLog(unittest.TestCase):
|
||||||
sys.hexversion < 0x3000000, 'assertLogs is new in version 3.4')
|
sys.hexversion < 0x3000000, 'assertLogs is new in version 3.4')
|
||||||
def test_LogOutput(self):
|
def test_LogOutput(self):
|
||||||
"""Use proofofwork.LogOutput to log output of a shell command"""
|
"""Use proofofwork.LogOutput to log output of a shell command"""
|
||||||
def echo():
|
with self.assertLogs('default') as cm: # pylint: disable=no-member
|
||||||
"""Call the echo shell command"""
|
with proofofwork.LogOutput('+'):
|
||||||
with proofofwork.LogOutput():
|
|
||||||
subprocess.call(['echo', 'HELLO'])
|
subprocess.call(['echo', 'HELLO'])
|
||||||
self.assertLogs(echo(), 'HELLO') # pylint: disable=no-member
|
|
||||||
|
self.assertEqual(cm.output, ['INFO:default:+: HELLO\n'])
|
||||||
|
|
Reference in New Issue
Block a user