Twisted's TestCase has `mktemp` which saves a bit of hassle (and cleans up the temporary files). See http://twistedmatrix.com/documents/8.2.0/api/twisted.trial.unittest.TestCase.html#mktemp