minimum changes to test_foo so opening files is done in a more pythonic way. Got rid of the prints