)]}'
{"nova/tests/spy.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"398d210a5f1dbf393d5fb16e85b4df4d3142dfc1","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    _spy \u003d _generate_spy(original, data, before, after)"},{"line_number":67,"context_line":"    # NOTE(gibi): cannot use side_effect here as that mysteriously breaks the"},{"line_number":68,"context_line":"    # call args of the original call if the target function is a bound method"},{"line_number":69,"context_line":"    # TODO(efried): Sure would be nice to figure out a way to yield the mock,"},{"line_number":70,"context_line":"    #  so the caller can use normal things like call_count etc. But"},{"line_number":71,"context_line":"    #  mock.patch.object returns _spy itself :("},{"line_number":72,"context_line":"    with mock.patch.object(target, func_name, new\u003d_spy):"},{"line_number":73,"context_line":"        yield"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_1dbbb20e","line":71,"range":{"start_line":69,"start_character":0,"end_line":71,"end_character":47},"updated":"2019-10-02 15:37:31.000000000","message":"Yeah this is the \u0027side effect\u0027 of using new\u003d_spy below. But I don\u0027t see any other way to avoid \u0027new\u003d\u0027 as for me side_effect doesn\u0027t work for bound methods.","commit_id":"da271c5ce9bf27d8df3f27c18c9d54a2f3469ed0"}],"nova/tests/unit/test_spy.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"398d210a5f1dbf393d5fb16e85b4df4d3142dfc1","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        tracker \u003d dict(before_calls\u003d[], after_calls\u003d[])"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        def spy_before(data, *args, **kwargs):"},{"line_number":40,"context_line":"            data[\u0027before_calls\u0027].append((args, kwargs))"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        def spy_after(data, result, *args, **kwargs):"},{"line_number":43,"context_line":"            data[\u0027after_calls\u0027].append((args, kwargs, result))"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_7d26666b","line":40,"updated":"2019-10-02 15:37:31.000000000","message":"As we are not using tracker directly here, this is free from the scope magic. But I guess Dan would like to use tracker directly as that is more explicit.\n\nInterestingly this solution allows using tracker directly as well.","commit_id":"da271c5ce9bf27d8df3f27c18c9d54a2f3469ed0"}]}
