TST: silence deprecation warnings for bad index calls

Some bad indexing calls throw exceptions and deprecations, silence the
warnings in the test.
Merge pull request #5007 from juliantaylor/dep-silence

TST: silence deprecation warnings for bad index calls