guberti commented on code in PR #13627:
URL: https://github.com/apache/tvm/pull/13627#discussion_r1057978156


##########
docs/conf.py:
##########
@@ -84,6 +86,148 @@ def git_describe_version(original_version):
 version = git_describe_version(tvm.__version__)
 release = version
 
+
+def monkey_patch(module_name, func_name):

Review Comment:
   Using stdlib functions is always good, but `unittest.mock.patch` does not 
quite fit this use case. I can't use `@patch` as a decorator, as the decorator 
must be used on the function **calling** the function we wish to monkey-patch 
(e.g. `save_rst_example`).
   
   I could just call `patch` as a function afterwards, but `patch` also does 
not include functionality for wrapping functions. It would be possible to make 
`patch()` work, but I think writing our own decorator is cleaner.
   
   I've clarified the comment to better explain this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to