Use a context manager to auto-close the test file