)]}'
{"oslo_utils/eventletutils.py":[{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"784d2a83e56ca1faf41a73619a169d60c66d8faa","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                              RuntimeWarning, stacklevel\u003d3)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"def is_eventlet_monkey_patched(module):"},{"line_number":133,"context_line":"    \"\"\"Determines safely is eventlet patching for module enabled or not"},{"line_number":134,"context_line":"    :param module: String, module name"},{"line_number":135,"context_line":"    :return Bool, True if module is patched, False otherwise"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a1b2928_99d8c91f","line":132,"updated":"2016-04-11 11:35:28.000000000","message":"Is it really useful to repeat \"eventlet\" in the function name? It\u0027s already in the module name, and in OpenStack, we only import modules, not function.","commit_id":"b221eaad34a4528cf11206ab321604716c0dacdc"},{"author":{"_account_id":8601,"name":"Dmitriy Ukhlov","email":"dukhlov@mirantis.com","username":"dukhlov"},"change_message_id":"fee934e8dcebd345f92d20fb3da6b44363fb88fe","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                              RuntimeWarning, stacklevel\u003d3)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"def is_eventlet_monkey_patched(module):"},{"line_number":133,"context_line":"    \"\"\"Determines safely is eventlet patching for module enabled or not"},{"line_number":134,"context_line":"    :param module: String, module name"},{"line_number":135,"context_line":"    :return Bool, True if module is patched, False otherwise"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a1b2928_b99305fa","line":132,"updated":"2016-04-11 11:34:21.000000000","message":"It would be nice method which could be used for warn_eventlet_not_patched too to reduce code duplication","commit_id":"b221eaad34a4528cf11206ab321604716c0dacdc"},{"author":{"_account_id":13290,"name":"Oleksii Zamiatin","email":"ozamiatin@mirantis.com","username":"ozamiatin"},"change_message_id":"5bbd5acc6c5a90798688b3afc8f3dedb5f50849f","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                              RuntimeWarning, stacklevel\u003d3)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"def is_eventlet_monkey_patched(module):"},{"line_number":133,"context_line":"    \"\"\"Determines safely is eventlet patching for module enabled or not"},{"line_number":134,"context_line":"    :param module: String, module name"},{"line_number":135,"context_line":"    :return Bool, True if module is patched, False otherwise"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a1b2928_2bd3183a","line":132,"in_reply_to":"7a1b2928_99d8c91f","updated":"2016-04-11 12:56:41.000000000","message":"Done","commit_id":"b221eaad34a4528cf11206ab321604716c0dacdc"},{"author":{"_account_id":13290,"name":"Oleksii Zamiatin","email":"ozamiatin@mirantis.com","username":"ozamiatin"},"change_message_id":"5bbd5acc6c5a90798688b3afc8f3dedb5f50849f","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                              RuntimeWarning, stacklevel\u003d3)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"def is_eventlet_monkey_patched(module):"},{"line_number":133,"context_line":"    \"\"\"Determines safely is eventlet patching for module enabled or not"},{"line_number":134,"context_line":"    :param module: String, module name"},{"line_number":135,"context_line":"    :return Bool, True if module is patched, False otherwise"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a1b2928_6bfeb06c","line":132,"in_reply_to":"7a1b2928_b99305fa","updated":"2016-04-11 12:56:41.000000000","message":"I\u0027m not sure this is really needed because the warn_eventlet_not_patched method works with patcher directly few times and checks it beforehand once, so we will gain nothing from new function here.","commit_id":"b221eaad34a4528cf11206ab321604716c0dacdc"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"784d2a83e56ca1faf41a73619a169d60c66d8faa","unresolved":false,"context_lines":[{"line_number":135,"context_line":"    :return Bool, True if module is patched, False otherwise"},{"line_number":136,"context_line":"    \"\"\""},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    if not _patcher:"},{"line_number":139,"context_line":"        return False"},{"line_number":140,"context_line":"    return _patcher.is_monkey_patched(module)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a1b2928_9955691f","line":138,"updated":"2016-04-11 11:35:28.000000000","message":"I suggest \"if _patcher is None:\"","commit_id":"b221eaad34a4528cf11206ab321604716c0dacdc"},{"author":{"_account_id":13290,"name":"Oleksii Zamiatin","email":"ozamiatin@mirantis.com","username":"ozamiatin"},"change_message_id":"5bbd5acc6c5a90798688b3afc8f3dedb5f50849f","unresolved":false,"context_lines":[{"line_number":135,"context_line":"    :return Bool, True if module is patched, False otherwise"},{"line_number":136,"context_line":"    \"\"\""},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    if not _patcher:"},{"line_number":139,"context_line":"        return False"},{"line_number":140,"context_line":"    return _patcher.is_monkey_patched(module)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a1b2928_0bd8dc52","line":138,"in_reply_to":"7a1b2928_9955691f","updated":"2016-04-11 12:56:41.000000000","message":"Done","commit_id":"b221eaad34a4528cf11206ab321604716c0dacdc"},{"author":{"_account_id":8601,"name":"Dmitriy Ukhlov","email":"dukhlov@mirantis.com","username":"dukhlov"},"change_message_id":"cfe71978d2eade8c66bc57140b805dc3e2376aae","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                              RuntimeWarning, stacklevel\u003d3)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"def is_monkey_patched(module):"},{"line_number":133,"context_line":"    \"\"\"Determines safely is eventlet patching for module enabled or not"},{"line_number":134,"context_line":"    :param module: String, module name"},{"line_number":135,"context_line":"    :return Bool, True if module is patched, False otherwise"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a1b2928_001eeeb9","line":132,"updated":"2016-04-11 14:16:03.000000000","message":"function warn_eventlet_not_patched does almost the same as this new function does but instead of returning boolean value as result just prints or not warning. I have meant that we could create is_patched base on warn_not_patched just by removing last warning and returning value and construct warn_not_patched as Log.warn if not is_patched","commit_id":"4d14c4ff2099ee579dd46b7dd8f9558d8e7633b8"},{"author":{"_account_id":13290,"name":"Oleksii Zamiatin","email":"ozamiatin@mirantis.com","username":"ozamiatin"},"change_message_id":"09624e5a54e2a60a06adf34bcb283b4cb5e98889","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                              RuntimeWarning, stacklevel\u003d3)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"def is_monkey_patched(module):"},{"line_number":133,"context_line":"    \"\"\"Determines safely is eventlet patching for module enabled or not"},{"line_number":134,"context_line":"    :param module: String, module name"},{"line_number":135,"context_line":"    :return Bool, True if module is patched, False otherwise"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a1b2928_0e745f33","line":132,"in_reply_to":"7a1b2928_001eeeb9","updated":"2016-04-11 14:39:35.000000000","message":"This makes sense","commit_id":"4d14c4ff2099ee579dd46b7dd8f9558d8e7633b8"}],"oslo_utils/tests/test_eventletutils.py":[{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"784d2a83e56ca1faf41a73619a169d60c66d8faa","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    @mock.patch(\"oslo_utils.eventletutils._patcher\")"},{"line_number":82,"context_line":"    def test_eventlet_is_patched(self, mock_patcher):"},{"line_number":83,"context_line":"        eventletutils.is_eventlet_monkey_patched(\u0027os\u0027)"},{"line_number":84,"context_line":"        self.assertTrue(mock_patcher.is_monkey_patched.return_value)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    @mock.patch(\"oslo_utils.eventletutils._patcher\")"},{"line_number":87,"context_line":"    def test_partially_patched_warning(self, mock_patcher):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a1b2928_f9629d15","line":84,"updated":"2016-04-11 11:35:28.000000000","message":"I don\u0027t understand the test. What are you testing?\n\nYou should mock eventlet.is_monkey_patched(\u0027os\u0027) to return True and then test that eventletutils.is_eventlet_monkey_patched(\u0027os\u0027) result is True.\n\nYou should also test with a mock which returns False, and another mock to set _patcher to None.","commit_id":"b221eaad34a4528cf11206ab321604716c0dacdc"},{"author":{"_account_id":13290,"name":"Oleksii Zamiatin","email":"ozamiatin@mirantis.com","username":"ozamiatin"},"change_message_id":"5bbd5acc6c5a90798688b3afc8f3dedb5f50849f","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    @mock.patch(\"oslo_utils.eventletutils._patcher\")"},{"line_number":82,"context_line":"    def test_eventlet_is_patched(self, mock_patcher):"},{"line_number":83,"context_line":"        eventletutils.is_eventlet_monkey_patched(\u0027os\u0027)"},{"line_number":84,"context_line":"        self.assertTrue(mock_patcher.is_monkey_patched.return_value)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    @mock.patch(\"oslo_utils.eventletutils._patcher\")"},{"line_number":87,"context_line":"    def test_partially_patched_warning(self, mock_patcher):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a1b2928_bf73e24c","line":84,"in_reply_to":"7a1b2928_f9629d15","updated":"2016-04-11 12:56:41.000000000","message":"Done","commit_id":"b221eaad34a4528cf11206ab321604716c0dacdc"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"2db182a1903948131dc3bf360c52a0cc84643823","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        self.assertEqual(0, len(capture))"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    @mock.patch(\"oslo_utils.eventletutils.is_monkey_patched\","},{"line_number":82,"context_line":"                return_value\u003dTrue)"},{"line_number":83,"context_line":"    def test_eventlet_is_patched(self, mock_function):"},{"line_number":84,"context_line":"        self.assertTrue(eventletutils.is_monkey_patched(\u0027os\u0027))"},{"line_number":85,"context_line":"        mock_function.assert_called_with(\u0027os\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a1b2928_dacea982","line":82,"range":{"start_line":82,"start_character":29,"end_line":82,"end_character":33},"updated":"2016-04-11 14:05:30.000000000","message":"wait, what? why do you mock a function and then call the mock? What is the purpose of this test?\n\nMaybe you want to mock eventlet.patcher.is_monkey_patched?","commit_id":"4d14c4ff2099ee579dd46b7dd8f9558d8e7633b8"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"3144f4859f7731894f66565372e574be5039c3d1","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        mock_patcher.is_monkey_patched.return_value \u003d False"},{"line_number":86,"context_line":"        self.assertFalse(eventletutils.is_monkey_patched(\u0027os\u0027))"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    @mock.patch(\"oslo_utils.eventletutils\")"},{"line_number":89,"context_line":"    def test_eventlet_no_patcher(self, mock_utils):"},{"line_number":90,"context_line":"        mock_utils._patcher \u003d None"},{"line_number":91,"context_line":"        self.assertFalse(eventletutils.is_monkey_patched(\u0027os\u0027))"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a1b2928_35c1a3e5","line":88,"updated":"2016-04-11 16:37:20.000000000","message":"I don\u0027t think that it\u0027s ok to mock the whole module you are testing.\n\nThe second parameter of patch() is the new value of the mocked object: you should try:\n\n@mock.patch(\"oslo_utils.eventletutils._patcher\", None)\n\nhttps://docs.python.org/dev/library/unittest.mock.html#patch","commit_id":"2c9a4251e30450d3bceef9ecdda93c1a4f5df140"}]}
