Skip to content

Commit 1428e75

Browse files
authored
Relint test_venv.py and fix trailing whitespace
Address linting failures in the new test_install_scripts_mtime by removing redundant imports and fixing trailing whitespace in the docstrings.
1 parent ec2958b commit 1428e75

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

Lib/test/test_venv.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -376,32 +376,31 @@ def create_contents(self, paths, filename):
376376
def test_install_scripts_mtime(self):
377377
"""
378378
Test that install_scripts does not preserve mtime when copying scripts.
379-
Using mtime serves as a proxy to verify that shutil.copy2 (and thus
379+
Using mtime serves as a proxy to verify that shutil.copy2 (and thus
380380
SELinux bin_t contexts) is not being used during script installation.
381381
"""
382382
import time
383-
from unittest.mock import patch
384-
383+
385384
builder = venv.EnvBuilder()
386385
builder.create(self.env_dir)
387386
context = builder.ensure_directories(self.env_dir)
388-
387+
389388
with tempfile.TemporaryDirectory() as script_dir:
390389
common_dir = os.path.join(script_dir, 'common')
391390
os.mkdir(common_dir)
392391
script_path = os.path.join(common_dir, 'test_script.sh')
393-
392+
394393
with open(script_path, 'wb') as f:
395394
f.write(b'echo Hello')
396-
395+
397396
past_time = time.time() - 10_000_000
398397
os.utime(script_path, (past_time, past_time))
399-
398+
400399
builder.install_scripts(context, script_dir)
401-
400+
402401
dst_path = os.path.join(context.bin_path, 'test_script.sh')
403402
self.assertTrue(os.path.exists(dst_path))
404-
403+
405404
new_mtime = os.path.getmtime(dst_path)
406405
self.assertGreater(new_mtime, past_time + 1000)
407406

0 commit comments

Comments
 (0)