Skip to content

Commit 02db5a6

Browse files
: python/tests/test_actors.py: use context mgr for config (#1946)
Summary: following up on mariusae 's comment (https://www.internalfb.com/diff/D87449483?dst_version_fbid=2613910452329247&transaction_fbid=2002832840481448) remove manual config save/restore boilerplate: ``` config = get_configuration() enable_log_forwarding = config["enable_log_forwarding"] # ... etc configure(enable_log_forwarding=True, ...) try: # test code finally: configure(enable_log_forwarding=enable_log_forwarding, ...) ``` replace with a context manager phrasing: ``` with configured(enable_log_forwarding=True, enable_file_capture=True, tail_log_lines=100): # test code ``` i intend to follow this diff up with one for the FD + sys.stdout/sys.stderr redirection Reviewed By: thedavekwon Differential Revision: D87478665
1 parent d00c6c4 commit 02db5a6

File tree

1 file changed

+583
-628
lines changed

1 file changed

+583
-628
lines changed

0 commit comments

Comments
 (0)