[issue15626] unittest.main negates -bb option and programmatic warning configuration

STINNER Victor report at bugs.python.org
Wed Dec 12 10:05:33 EST 2018


STINNER Victor <vstinner at redhat.com> added the comment:

> Something was changed in 3.7

Yeah, Python 3.7 handles warning options differently: there is the PEP 565 and this commit:

commit 747f48e2e92390c44c72f52a1239959601cde157
Author: Victor Stinner <victor.stinner at gmail.com>
Date:   Tue Dec 12 22:59:48 2017 +0100

    bpo-32230: Set sys.warnoptions with -X dev (#4820)
    
    Rather than supporting dev mode directly in the warnings module, this
    instead adjusts the initialisation code to add an extra 'default'
    entry to sys.warnoptions when dev mode is enabled.
    
    This ensures that dev mode behaves *exactly* as if `-Wdefault` had
    been passed on the command line, including in the way it interacts
    with `sys.warnoptions`, and with other command line flags like `-bb`.
    
    Fix also bpo-20361: have -b & -bb options take precedence over any
    other warnings options.
    
    Patch written by Nick Coghlan, with minor modifications of Victor Stinner.

----------

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


More information about the Python-bugs-list mailing list