summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2022-09-24 21:21:34 -0400
committerJason R. Coombs <jaraco@jaraco.com>2022-09-24 21:21:34 -0400
commite115de75a02a0709c1372157bfcd55fa3263074b (patch)
treed29a861ebf81f39d6e2e97b948a386778e0093f9
parent917d8e26a64a40de0a0b77085f1fa6d054af0ee8 (diff)
downloadpython-setuptools-git-e115de75a02a0709c1372157bfcd55fa3263074b.tar.gz
Replace TESTFN with fixture.
-rw-r--r--distutils/tests/test_spawn.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/distutils/tests/test_spawn.py b/distutils/tests/test_spawn.py
index d2a898ed..5007936e 100644
--- a/distutils/tests/test_spawn.py
+++ b/distutils/tests/test_spawn.py
@@ -44,18 +44,18 @@ class TestSpawn(support.TempdirManager, support.LoggingSilencer):
os.chmod(exe, 0o777)
spawn([exe]) # should work without any error
- def test_find_executable(self):
- with os_helper.temp_dir() as tmp_dir:
- # use TESTFN to get a pseudo-unique filename
- program_noeext = os_helper.TESTFN
+ def test_find_executable(self, tmp_path):
+ if True:
+ program_noeext = 'program'
# Give the temporary program an ".exe" suffix for all.
# It's needed on Windows and not harmful on other platforms.
program = program_noeext + ".exe"
- filename = os.path.join(tmp_dir, program)
- with open(filename, "wb"):
- pass
- os.chmod(filename, stat.S_IXUSR)
+ program_path = tmp_path / program
+ program_path.write_text("")
+ program_path.chmod(stat.S_IXUSR)
+ filename = str(program_path)
+ tmp_dir = str(tmp_path)
# test path parameter
rv = find_executable(program, path=tmp_dir)