@mock_streams('stdout')
def test_puts_with_prefix():
 s = 'my output'
 h = 'localhost'
 with settings(host_string=h):
  puts(s)
 eq_(sys.stdout.getvalue(), ('[%s] %s' % (h, (s + '\n'))))

@ mock_streams ( 'stdout' ) def test_puts_with_prefix ( ) : s = 'my output' h = 'localhost' with settings ( host_string = h ) : puts ( s ) eq_ ( sys . stdout . getvalue ( ) , ( '[%s] %s' % ( h , ( s + '\n' ) ) ) )
puts() should prefix output with env .