REF/TST: Add more pytest idiom to indexing/multiindex/test_getitem.py
State: closed

- [ n/a] xref #24040
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ n/a] whatsnew entry

in this pass:
- follow-on from #24053

Labels:
name: Refactor
description: Internal refactoring of code
name: Testing
description: pandas testing functions or related to the test suite

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24409?src=pr&el=h1) Report
> Merging [#24409](https://codecov.io/gh/pandas-dev/pandas/pull/24409?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/fc7bc3f74d1f5702bf66c519ad190126538a8f5b?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/24409/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/24409?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #24409   +/-   ##
=======================================
  Coverage    92.3%    92.3%           
=======================================
  Files         163      163           
  Lines       51943    51943           
=======================================
  Hits        47946    47946           
  Misses       3997     3997
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.71% <ø> (ø)` | :arrow_up: |
| #single | `43% <ø> (ø)` | :arrow_up: |


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24409?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24409?src=pr&el=footer). Last update [fc7bc3f...d73a620](https://codecov.io/gh/pandas-dev/pandas/pull/24409?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24409?src=pr&el=h1) Report
> Merging [#24409](https://codecov.io/gh/pandas-dev/pandas/pull/24409?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/fc7bc3f74d1f5702bf66c519ad190126538a8f5b?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/24409/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/24409?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #24409   +/-   ##
=======================================
  Coverage    92.3%    92.3%           
=======================================
  Files         163      163           
  Lines       51943    51943           
=======================================
  Hits        47946    47946           
  Misses       3997     3997
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.71% <ø> (ø)` | :arrow_up: |
| #single | `43% <ø> (ø)` | :arrow_up: |


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24409?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24409?src=pr&el=footer). Last update [fc7bc3f...d73a620](https://codecov.io/gh/pandas-dev/pandas/pull/24409?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

thanks @simonjayhawkins 
I think these are no longer filtered?
```
=============================================================================================================================== warnings summary ================================================================================================================================
pandas/tests/indexing/multiindex/test_getitem.py::test_series_getitem_fancy[<lambda>1]
  /Users/jreback/pandas/pandas/tests/indexing/multiindex/test_getitem.py:173: DeprecationWarning: 
  .ix is deprecated. Please use
  .loc for label based indexing or
  .iloc for positional indexing
  
  See the documentation here:
  http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated
    lambda s: s.ix[[(2000, 3, 10), (2000, 3, 13)]]

pandas/tests/indexing/multiindex/test_getitem.py::test_getitem_tuple_plus_slice
  /Users/jreback/pandas/pandas/tests/indexing/multiindex/test_getitem.py:232: DeprecationWarning: 
  .ix is deprecated. Please use
  .loc for label based indexing or
  .iloc for positional indexing
  
  See the documentation here:
  http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated
    expected3 = idf.ix[0, 0]

-- Docs: http://doc.pytest.org/en/latest/warnings.html
```
@jreback . it appears that pytest is no longer behaving with regex.. could be https://github.com/pytest-dev/pytest/issues/3936. but i've not checked thoroughly.

for the meantime i'm not currently replacing any `with catch_warnings(record=True):
`  or `simplefilter("ignore", DeprecationWarning)` and relying on pytest.

the other alternative is to be less explicit and use `@pytest.mark.filterwarnings("ignore::DeprecationWarning")` and then maybe return at a later date and add `\\nPanel` and `\\n.ix` etc.