The new HWSimRadio context manager allows the following syntax to create (and appropriately destroy) a new radio: with HWSimRadio([...]) as (radio_id, iface_name): [...] Signed-off-by: Johannes Berg <johannes.berg@intel.com>