diff options
author | Jesse-Bakker <jessebakker00@gmail.com> | 2017-11-29 23:05:07 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-11-29 23:05:07 (GMT) |
commit | 706e10b186992e086e661a62d2c8ec9588525b31 (patch) | |
tree | 6ef28e2e18a1183757d3a31236c2b5e8b4434254 /Lib/test/test_warnings | |
parent | 859f7ce7a49f8bd6309748c05e460c10f6a433ed (diff) | |
download | cpython-706e10b186992e086e661a62d2c8ec9588525b31.zip cpython-706e10b186992e086e661a62d2c8ec9588525b31.tar.gz cpython-706e10b186992e086e661a62d2c8ec9588525b31.tar.bz2 |
bpo-32121: Add most_recent_first parameter to tracemalloc.Traceback.format (#4534)
* Add most_recent_first parameter to tracemalloc.Traceback.format to allow
reversing the order of the frames in the output
* Reversed default sorting of tracemalloc.Traceback frames
* Allowed negative limit, truncating from the other side.
Diffstat (limited to 'Lib/test/test_warnings')
-rw-r--r-- | Lib/test/test_warnings/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_warnings/__init__.py b/Lib/test/test_warnings/__init__.py index f2fdaa5..e60bc4d 100644 --- a/Lib/test/test_warnings/__init__.py +++ b/Lib/test/test_warnings/__init__.py @@ -941,11 +941,11 @@ class PyWarningsDisplayTests(WarningsDisplayTests, unittest.TestCase): expected = textwrap.dedent(''' {fname}:5: ResourceWarning: unclosed file <...> f = None - Object allocated at (most recent call first): - File "{fname}", lineno 3 - f = open(__file__) + Object allocated at (most recent call last): File "{fname}", lineno 7 func() + File "{fname}", lineno 3 + f = open(__file__) ''') expected = expected.format(fname=support.TESTFN).strip() self.assertEqual(stderr, expected) |