]> granicus.if.org Git - python/commit
bpo-34239: Convert test_bz2 to use tempfile (#8485)
authorTim Golden <mail@timgolden.me.uk>
Thu, 26 Jul 2018 21:05:00 +0000 (22:05 +0100)
committerGitHub <noreply@github.com>
Thu, 26 Jul 2018 21:05:00 +0000 (22:05 +0100)
commit6a62e1d365934de82ff7c634981b3fbf218b4d5f
tree71310dcc25bc62aa6791b991294b2e483724ebb3
parent56b29b6d6fa3eb32bb1533ee3f21b1e7135648a0
bpo-34239: Convert test_bz2 to use tempfile (#8485)

* bpo-34239: Convert test_bz2 to use tempfile

test_bz2 currently uses the test.support.TESTFN functionality which creates a temporary file local to the test directory named around the pid.

This can give rise to race conditions where tests are competing with each other to delete and recreate the file.

This change converts the tests to use tempfile.mkstemp which gives a different file every time from the system's temp area
Lib/test/test_bz2.py