]> granicus.if.org Git - python/commit
bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. (#1341)
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 28 Apr 2017 16:17:26 +0000 (19:17 +0300)
committerVictor Stinner <victor.stinner@gmail.com>
Fri, 28 Apr 2017 16:17:26 +0000 (18:17 +0200)
commitd1a1def7bf221b04dcf3fc3a67aa19aa2f622f83
tree0d13f2482de3cad5c65d9507d1bb4a27234578a6
parent80a3da4d4aad0b51893e1e2f696b6252eca80e07
bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. (#1341)

* bpo-30197: Enhance functions swap_attr() and swap_item() in test.support.

They now work when delete replaced attribute or item inside the with
statement.  The old value of the attribute or item (or None if it doesn't
exist) now will be assigned to the target of the "as" clause, if there is
one.

* Update docstrings.
Lib/test/support/__init__.py
Lib/test/test_support.py
Lib/test/test_tempfile.py
Misc/NEWS