diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2021-11-23 13:43:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-23 13:43:40 (GMT) |
commit | 8ed1495ad900dd815ff8fb97926da5312aaa23f9 (patch) | |
tree | 809effba278ac5513f1073b662da77f7e50301f1 /Lib/test/test_tools | |
parent | b48ac6fe38b2fca9963b097c04cdecfc6083104e (diff) | |
download | cpython-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.py | 9 |
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...') |