Commit 068c505
python/tests/test_actors.py: use context mgr for config (#1946)
Summary:
Pull Request resolved: #1946
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
fbshipit-source-id: 80e65ee72be72ee1e7ee2aa352600566fc6f0e4c1 parent 34fb812 commit 068c505
1 file changed
+583
-628
lines changed
0 commit comments