make sure to close the stream at the end of each test