another implementation of log_interval
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/543 The previous implementation: > the problem is the ContextDecorator somehow swallows the exception in the wrapped function and just returns None. This diff adds a test such that previous implementation would fail: ``` ====================================================================== FAIL: test_log_interval_error_prop (d2go.tests.fb.test_utils_logging.TestUtilsLogging) Make sure the log_interval can handle error propagation. ---------------------------------------------------------------------- Traceback (most recent call last): File "/data/sandcastle/boxes/fbsource/buck-out/v2/gen/fbcode/ef4169ac7f95fb74/mobile-vision/d2go/tests/__init_tests__/init_tests#link-tree/d2go/tests/fb/test_utils_logging.py", line 152, in test_log_interval_error_prop foo(-1) AssertionError: ValueError not raised ---------------------------------------------------------------------- Ran 1 test in 0.098s ``` The new version seems easier to understand and doesn't have the error swallowing. Reviewed By: jaconey Differential Revision: D46009938 fbshipit-source-id: 6b632deb513ab47c4d760f796bf49fc45eae3005
Showing
Please register or sign in to comment