jw-python/test/mute-stdio/main.py

14 lines
344 B
Python
Raw Normal View History

import jwutil
print "This is without muted output"
with jwutil.MuteStdIO():
print "This is with muted output"
with jwutil.MuteStdIO():
print "This will have an error"
print "Second suppressed line of output"
print "Third suppressed line of output"
raise Exception("Something went wrong")
print "Output is unmuted again"