This test should use py.test's tmpdir fixture, not tempfile (this test actually breaks on Windows since there are multiple attempts to open the same tempfile)