)]}'
{"test/unit/__init__.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"e968fa5907138bfff37615de9f6bfa846a7c03de","unresolved":false,"context_lines":[{"line_number":183,"context_line":"                raise"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        def tearDown(cls_self):"},{"line_number":186,"context_line":"            orig_tearDown(cls_self)"},{"line_number":187,"context_line":"            self.__exit__()"},{"line_number":188,"context_line":"            cls_self._policies_patched \u003d False"},{"line_number":189,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1f013ff3_e49e5053","line":186,"updated":"2017-05-12 16:52:37.000000000","message":"I think that to be totally safe we should have:\n\n  if getattr(cls_self, \u0027_policies_patched\u0027, False):\n      self.__exit__()\n      cls_self._policies_patched \u003d False\n\notherwise it might be possible to  call self.__exit__() when self.__enter__() has not been called and self has no _orig_POLICIES attribute.\n\nAdmittedly the only way i can see to reach that state would be for self.__enter__ to raise and exception in setUp, in which case I think the test runner would not call tearDown, but for safety we should perhaps not rely on that test runner behaviour.","commit_id":"4dcc9d35522c10dfa31cadf60bf1971a672d5bbb"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"8a7d7cd7201c3488400fa1e0022130c56a76f0b6","unresolved":false,"context_lines":[{"line_number":183,"context_line":"                raise"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        def tearDown(cls_self):"},{"line_number":186,"context_line":"            orig_tearDown(cls_self)"},{"line_number":187,"context_line":"            self.__exit__()"},{"line_number":188,"context_line":"            cls_self._policies_patched \u003d False"},{"line_number":189,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1f013ff3_a4a72850","line":186,"in_reply_to":"1f013ff3_e49e5053","updated":"2017-05-12 17:11:42.000000000","message":"Done","commit_id":"4dcc9d35522c10dfa31cadf60bf1971a672d5bbb"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a7e58353cbc675b00bcac72713047e08a78001af","unresolved":false,"context_lines":[{"line_number":180,"context_line":"            except:  # noqa"},{"line_number":181,"context_line":"                self.__exit__()"},{"line_number":182,"context_line":"                cls_self._policies_patched \u003d False"},{"line_number":183,"context_line":"                raise"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        def tearDown(cls_self):"},{"line_number":186,"context_line":"            orig_tearDown(cls_self)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f013ff3_6f99f91d","line":183,"updated":"2017-05-12 18:38:50.000000000","message":"just do it in a finally, or maybe is our unittest new enough to have addCleanup? [1]\n\n1. https://docs.python.org/2/library/unittest.html#unittest.TestCase.addCleanup","commit_id":"b06db532dfd348ce76fddaac081e219a0d75d430"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"5f213f4adb1bc0c02ade408ad0df2b62391182ef","unresolved":false,"context_lines":[{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        def setUp(cls_self):"},{"line_number":178,"context_line":"            if not getattr(cls_self, \u0027_policies_patched\u0027, False):"},{"line_number":179,"context_line":"                self.__enter__()"},{"line_number":180,"context_line":"                cls_self._policies_patched \u003d True"},{"line_number":181,"context_line":"                cls_self.addCleanup(unpatch_cleanup, cls_self)"},{"line_number":182,"context_line":"            orig_setUp(cls_self)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f013ff3_d5341ce1","line":179,"updated":"2017-05-12 21:59:53.000000000","message":"if _setup_rings in __enter__ raises an exception then we won\u0027t unpatch because the cleanup hasn\u0027t been registered :(","commit_id":"eb1c28389517f00b2d01472e26b201137991f91b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"5f213f4adb1bc0c02ade408ad0df2b62391182ef","unresolved":false,"context_lines":[{"line_number":195,"context_line":"    def __enter__(self):"},{"line_number":196,"context_line":"        self._orig_POLICIES \u003d storage_policy._POLICIES"},{"line_number":197,"context_line":"        storage_policy._POLICIES \u003d self.policies"},{"line_number":198,"context_line":"        self._setup_rings()"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    def __exit__(self, *args):"},{"line_number":201,"context_line":"        storage_policy._POLICIES \u003d self._orig_POLICIES"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f013ff3_55980c69","line":198,"range":{"start_line":198,"start_character":8,"end_line":198,"end_character":27},"updated":"2017-05-12 21:59:53.000000000","message":"if this blows up, then we leave __enter__ with policies patched but __exit__ won\u0027t be called when used as a context manager, nor when used from setUp(). So policies stays patched.\n\nsame was true on last patchset I think.","commit_id":"eb1c28389517f00b2d01472e26b201137991f91b"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"97ea582c14a88937368dee5c6b01775120491dc7","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        try:"},{"line_number":199,"context_line":"            self._setup_rings()"},{"line_number":200,"context_line":"        except:  # noqa"},{"line_number":201,"context_line":"            self.__exit__()"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def __exit__(self, *args):"},{"line_number":204,"context_line":"        storage_policy._POLICIES \u003d self._orig_POLICIES"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff0f0b1f_dcb87dc9","line":201,"updated":"2017-05-19 06:19:30.000000000","message":"should we re-raise here to show correct error for the test?\n\nOtherwise, the test will run with incorrect POLICIES, right?","commit_id":"120c00184bfdaf048f764b7838cda96ca4e2b0f8"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"434b6b168f51104502928c298b4056393eb54bd0","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        try:"},{"line_number":199,"context_line":"            self._setup_rings()"},{"line_number":200,"context_line":"        except:  # noqa"},{"line_number":201,"context_line":"            self.__exit__()"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def __exit__(self, *args):"},{"line_number":204,"context_line":"        storage_policy._POLICIES \u003d self._orig_POLICIES"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff0f0b1f_0d746198","line":201,"in_reply_to":"ff0f0b1f_dcb87dc9","updated":"2017-05-20 00:59:58.000000000","message":"Good call.","commit_id":"120c00184bfdaf048f764b7838cda96ca4e2b0f8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"45ea49f374fde15be2bf1da63325ad33d7b6c5a4","unresolved":false,"context_lines":[{"line_number":199,"context_line":"            self._setup_rings()"},{"line_number":200,"context_line":"        except:  # noqa"},{"line_number":201,"context_line":"            self.__exit__()"},{"line_number":202,"context_line":"            raise"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def __exit__(self, *args):"},{"line_number":205,"context_line":"        storage_policy._POLICIES \u003d self._orig_POLICIES"}],"source_content_type":"text/x-python","patch_set":7,"id":"ff0f0b1f_45106200","line":202,"range":{"start_line":202,"start_character":12,"end_line":202,"end_character":17},"updated":"2017-05-25 08:24:06.000000000","message":"+1. my bad on previous patchset where I added the try/except","commit_id":"1b991803e887de94885f12ae6f7db9227e442281"}]}
