Would it be worth using the ```py.test``` support for monkeypatching here? Or is that overkill? It might avoid an untrapped exception leaving ```sys.platform``` set wrong.