TST: use capsys.readouterr() as named tuple
State: closed

currently only one test in codebase uses capsys.readouterr().

from pytest 3.3, the return value from readouterr changed to a namedtuple with two attributes, out and err.

this change in the style of https://docs.pytest.org/en/latest/capture.html#accessing-captured-output-from-a-test-function is to ensure that the current usage in the codebase does not set a precedent for future usage.

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/24489?src=pr&el=h1) Report
> Merging [#24489](https://codecov.io/gh/pandas-dev/pandas/pull/24489?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/41b2b18b94ade34a172483cf8307ce16bbbfc7c1?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/24489/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/24489?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #24489   +/-   ##
=======================================
  Coverage    92.3%    92.3%           
=======================================
  Files         166      166           
  Lines       52386    52386           
=======================================
  Hits        48357    48357           
  Misses       4029     4029
```

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


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24489?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/24489?src=pr&el=footer). Last update [41b2b18...47b8ffe](https://codecov.io/gh/pandas-dev/pandas/pull/24489?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/24489?src=pr&el=h1) Report
> Merging [#24489](https://codecov.io/gh/pandas-dev/pandas/pull/24489?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/41b2b18b94ade34a172483cf8307ce16bbbfc7c1?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/24489/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/24489?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #24489   +/-   ##
=======================================
  Coverage    92.3%    92.3%           
=======================================
  Files         166      166           
  Lines       52386    52386           
=======================================
  Hits        48357    48357           
  Misses       4029     4029
```

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


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24489?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/24489?src=pr&el=footer). Last update [41b2b18...47b8ffe](https://codecov.io/gh/pandas-dev/pandas/pull/24489?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/24489?src=pr&el=h1) Report
> Merging [#24489](https://codecov.io/gh/pandas-dev/pandas/pull/24489?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/41b2b18b94ade34a172483cf8307ce16bbbfc7c1?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/24489/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/24489?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #24489   +/-   ##
=======================================
  Coverage    92.3%    92.3%           
=======================================
  Files         166      166           
  Lines       52386    52386           
=======================================
  Hits        48357    48357           
  Misses       4029     4029
```

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


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24489?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/24489?src=pr&el=footer). Last update [41b2b18...47b8ffe](https://codecov.io/gh/pandas-dev/pandas/pull/24489?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/24489?src=pr&el=h1) Report
> Merging [#24489](https://codecov.io/gh/pandas-dev/pandas/pull/24489?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/41b2b18b94ade34a172483cf8307ce16bbbfc7c1?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/24489/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/24489?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #24489   +/-   ##
=======================================
  Coverage    92.3%    92.3%           
=======================================
  Files         166      166           
  Lines       52386    52386           
=======================================
  Hits        48357    48357           
  Misses       4029     4029
```

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


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24489?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/24489?src=pr&el=footer). Last update [41b2b18...47b8ffe](https://codecov.io/gh/pandas-dev/pandas/pull/24489?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

@gfyoung https://github.com/pandas-dev/pandas/pull/24489#pullrequestreview-188428229 is in some separate PRs
thanks!