Description
lang/py/test/test_tether_word_count.py is somewhat fragile. When it fails, the true failure is obscured by a secondary error because exfile is first defined on line 179 and may not even exist in the finally block.
I propose a significant refactor of this test to make the results clearer and to adhere to more idiomatic testing and python by:
- Isolating the main test from its setup and teardown using standard setUp and tearDown.
- Isolating the subprocess try/finally from the entire test setup/teardown.
- Avoid having to manage multiple temporary files by running the entire test in a temporary directory.