summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tools
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2021-11-23 13:43:40 (GMT)
committerGitHub <noreply@github.com>2021-11-23 13:43:40 (GMT)
commit8ed1495ad900dd815ff8fb97926da5312aaa23f9 (patch)
tree809effba278ac5513f1073b662da77f7e50301f1 /Lib/test/test_tools
parentb48ac6fe38b2fca9963b097c04cdecfc6083104e (diff)
downloadcpython-8ed1495ad900dd815ff8fb97926da5312aaa23f9.zip
cpython-8ed1495ad900dd815ff8fb97926da5312aaa23f9.tar.gz
cpython-8ed1495ad900dd815ff8fb97926da5312aaa23f9.tar.bz2
bpo-45783: Preserve file moves and deletions in the tests for the freeze tool. (GH-29527)
Use shutil.copytree rather than Git, which might be missing (or configured differently) when testing Python built from a source release.
Diffstat (limited to 'Lib/test/test_tools')
-rw-r--r--Lib/test/test_tools/test_freeze.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_tools/test_freeze.py b/Lib/test/test_tools/test_freeze.py
index 392a776..386c35a 100644
--- a/Lib/test/test_tools/test_freeze.py
+++ b/Lib/test/test_tools/test_freeze.py
@@ -5,6 +5,7 @@ import textwrap
import unittest
from test import support
+from test.support import os_helper
from . import imports_under_tool, skip_if_missing
skip_if_missing('freeze')
@@ -22,8 +23,8 @@ class TestFreeze(unittest.TestCase):
print('running...')
sys.exit(0)
""")
- outdir, scriptfile, python = helper.prepare(script)
-
- executable = helper.freeze(python, scriptfile, outdir)
- text = helper.run(executable)
+ with os_helper.temp_dir() as outdir:
+ outdir, scriptfile, python = helper.prepare(script, outdir)
+ executable = helper.freeze(python, scriptfile, outdir)
+ text = helper.run(executable)
self.assertEqual(text, 'running...')