TST: fix usage of assert_produces_warning
@jreback I just notices some tests were not using `assert_produces_warning` as a context manager, therefore these would never fail (you could put whatever in there).

I changed it to using `with`, as I don't think there is way to use that function not as a context?

@bashtage I also changed some of your tests. I am not familiar with this code, but I think this should still be correct
