[New-bugs-announce] [issue41297] Remove doctest import from heapq

alex c report at bugs.python.org
Tue Jul 14 17:49:24 EDT 2020


New submission from alex c <alexchandel at gmail.com>:

heapq.py imports doctest in the last 4 lines to perform unit tests:

    if __name__ == "__main__":
    
        import doctest # pragma: no cover
        print(doctest.testmod()) # pragma: no cover

This disrupts dependency tracking modules and software, like modulegraph and pyinstaller, as doctest brings in many dependencies (including ctypes as of 3.8).

This functionality could be factored out into a separate unit-testing file.

----------
components: Tests
messages: 373658
nosy: alexchandel
priority: normal
severity: normal
status: open
title: Remove doctest import from heapq
type: resource usage
versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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


More information about the New-bugs-announce mailing list