New submission from Frazer McLean:

In Lib/test/test_contextlib.py, there is a bug in the nested usage part of the 
following function:

def test_cm_is_reentrant(self): 
    ignore_exceptions = suppress(Exception) 
    with ignore_exceptions: 
        pass 
    with ignore_exceptions: 
        len(5) 
    with ignore_exceptions: 
        1/0 
        with ignore_exceptions: # Check nested usage 
            len(5)

Specifically, the final 2 lines aren't reached since the exception raised by 
1/0 exits the context manager.

----------
components: Tests
messages: 252382
nosy: RazerM, ncoghlan, yselivanov
priority: normal
severity: normal
status: open
title: contextlib.suppress not tested for nested usage
type: behavior
versions: Python 3.4, Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25322>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to