[issue31692] [2.7] Test `test_huntrleaks()` of test_regrtest fails in debug build with COUNT_ALLOCS

STINNER Victor report at bugs.python.org
Fri Oct 6 16:02:02 EDT 2017


STINNER Victor <victor.stinner at gmail.com> added the comment:

I wrote PR 3910 to modify COUNT_ALLOCS: alllcations statistics are now written into stderr, rather than stdout.

The PR contains also changes to fix tests with COUNT_ALLOCS. I'm not sure about this part of the PR. I would prefer to not dump statistics by default, and add a new option to enable it.

I don't know if we can easily implement "-X showalloccount", since Python 2.7 doesn't have sys._xoptions. Maybe we could use a new environment variable instead: PYTHONSHOWALLOCCOUNT=1?

I would prefer to add a new option instead of having to patch so many unit tests:

haypo at selma$ git diff 2.7.. --stat
 Lib/json/tests/test_tool.py                                                 |  8 ++++++--
 Lib/test/support/__init__.py                                                |  3 +++
 Lib/test/test_abc.py                                                        |  2 ++
 Lib/test/test_gc.py                                                         |  4 +++-
 Lib/test/test_hash.py                                                       |  2 +-
 Lib/test/test_module.py                                                     |  3 ++-
 Lib/test/test_multiprocessing.py                                            |  4 +++-
 Lib/test/test_regrtest.py                                                   |  1 +
 Lib/test/test_subprocess.py                                                 | 17 +++++++++++++++++
 Lib/test/test_sys.py                                                        | 21 +++++++++++++++------
 Lib/test/test_threading.py                                                  | 11 ++++++++---
 Lib/test/test_tools.py                                                      | 10 +++++++---
 Lib/test/test_warnings.py                                                   |  4 ++++
 Lib/test/test_weakref.py                                                    |  1 +
 Misc/NEWS.d/next/Core and Builtins/2017-10-06-21-56-47.bpo-31692.osJuVJ.rst |  2 ++
 Python/pythonrun.c                                                          |  2 +-
 16 files changed, 76 insertions(+), 19 deletions(-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31692>
_______________________________________


More information about the Python-bugs-list mailing list