Make test_queries save stdout in tox testr

Change-Id: Ie5aa0d399afe118e6520bbb1dc0c29cdb2f94090
Merge "Make test_queries save stdout in tox testr"