[issue45046] Add support of context managers in unittest

2021-08-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +26490 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28045 ___ Python tracker ___

[issue45046] Add support of context managers in unittest

2021-08-29 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Methods setUp() and tearDown() of TestClass allow to add some code executed before and after every test method. In many cases addCleanup() is more convenient than tearDown() -- you do not need to keep data for cleaning up as TestCase attributes, addClean