def test_hosts_decorator_overrides_env_hosts_with_task_decorator_first():
 @task
 @hosts('bar')
 def command():
  pass
 eq_hosts(command, ['bar'], env={'hosts': ['foo']})

def test_hosts_decorator_overrides_env_hosts_with_task_decorator_first ( ) : @ task @ hosts ( 'bar' ) def command ( ) : pass eq_hosts ( command , [ 'bar' ] , env = { 'hosts' : [ 'foo' ] } )
if @hosts is used it replaces any env .