bpo-40275: Use new test.support helper submodules in tests (GH-21449)
diff --git a/Lib/test/test_tracemalloc.py b/Lib/test/test_tracemalloc.py
index c5ae4e6..a0037f8 100644
--- a/Lib/test/test_tracemalloc.py
+++ b/Lib/test/test_tracemalloc.py
@@ -7,6 +7,7 @@
from test.support.script_helper import (assert_python_ok, assert_python_failure,
interpreter_requires_environment)
from test import support
+from test.support import os_helper
try:
import _testcapi
@@ -287,11 +288,11 @@
self.assertGreater(snapshot.traces[1].traceback.total_nframe, 10)
# write on disk
- snapshot.dump(support.TESTFN)
- self.addCleanup(support.unlink, support.TESTFN)
+ snapshot.dump(os_helper.TESTFN)
+ self.addCleanup(os_helper.unlink, os_helper.TESTFN)
# load from disk
- snapshot2 = tracemalloc.Snapshot.load(support.TESTFN)
+ snapshot2 = tracemalloc.Snapshot.load(os_helper.TESTFN)
self.assertEqual(snapshot2.traces, snapshot.traces)
# tracemalloc must be tracing memory allocations to take a snapshot
@@ -306,11 +307,11 @@
# take a snapshot with a new attribute
snapshot = tracemalloc.take_snapshot()
snapshot.test_attr = "new"
- snapshot.dump(support.TESTFN)
- self.addCleanup(support.unlink, support.TESTFN)
+ snapshot.dump(os_helper.TESTFN)
+ self.addCleanup(os_helper.unlink, os_helper.TESTFN)
# load() should recreate the attribute
- snapshot2 = tracemalloc.Snapshot.load(support.TESTFN)
+ snapshot2 = tracemalloc.Snapshot.load(os_helper.TESTFN)
self.assertEqual(snapshot2.test_attr, "new")
def fork_child(self):