We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ab0231 commit 00b5a8cCopy full SHA for 00b5a8c
1 file changed
Lib/test/test_atexit.py
@@ -1,11 +1,11 @@
1
import atexit
2
import os
3
import subprocess
4
-import tempfile
5
import textwrap
6
import unittest
7
from test import support
8
from test.support import SuppressCrashReport, script_helper
+from test.support import os_helper
9
from test.support import threading_helper
10
11
class GeneralTest(unittest.TestCase):
@@ -209,11 +209,8 @@ def callback():
209
_testcapi.set_nomemory(0)
210
""")
211
212
- with tempfile.NamedTemporaryFile(mode='w', suffix='.py') as f:
213
- f.write(code)
214
- f.flush()
215
- script = f.name
216
-
+ with os_helper.temp_dir() as temp_dir:
+ script = script_helper.make_script(temp_dir, 'test_atexit_script', code)
217
with SuppressCrashReport():
218
with script_helper.spawn_python(script,
219
stderr=subprocess.PIPE) as proc:
0 commit comments