Add buffering to unit tests

- Add buffering to unit tests so that output is kept with the output of
  the relevant test.