diff options
author | Hai Shi <shihai1992@gmail.com> | 2020-08-03 16:41:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-03 16:41:24 (GMT) |
commit | a7f5d93bb6906d0f999248b47295d3a59b130f4d (patch) | |
tree | a0dc5043ecc7a4250902f8d14c802382b1c94b8a /Lib/test/test_tracemalloc.py | |
parent | 488512bf4953d856fcb049a05060a450af52fcdc (diff) | |
download | cpython-a7f5d93bb6906d0f999248b47295d3a59b130f4d.zip cpython-a7f5d93bb6906d0f999248b47295d3a59b130f4d.tar.gz cpython-a7f5d93bb6906d0f999248b47295d3a59b130f4d.tar.bz2 |
bpo-40275: Use new test.support helper submodules in tests (GH-21449)
Diffstat (limited to 'Lib/test/test_tracemalloc.py')
-rw-r--r-- | Lib/test/test_tracemalloc.py | 13 |
1 files changed, 7 insertions, 6 deletions
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 unittest.mock import patch 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 @@ class TestTracemallocEnabled(unittest.TestCase): 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 @@ class TestTracemallocEnabled(unittest.TestCase): # 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): |