Remove use of with in a test helper used with python 2.4