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

14 lines
347 B
Python
Raw Normal View History

import jwutils
print "This is without muted output"
with jwutils.MuteStdIO():
print "This is with muted output"
with jwutils.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"