TST: Add test util for checking for warnings

Just checks that only warnings of the specified type were produced
and works as a context manager.
TST: Use assert_produces_warnings in test_groupby