Tests: allow custom stream when running tests