DOC: Remove preference for pytest paradigm in assert_raises_regex
State: closed

`tm.assert_raises_regex` is a more compact version of the following:

~~~python
with pytest.raises(<exc_type>) as exc_info:
   f(...)
exc_info.match(<regex>)
~~~

No reason for the docs to say that we prefer the `pytest` paradigm over our own.

xref <a href="https://github.com/pandas-dev/pandas/pull/16511#discussion_r118771331">#16511 (comment)</a>

Labels:

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

```diff
@@           Coverage Diff           @@
##           master   #16518   +/-   ##
=======================================
  Coverage   90.79%   90.79%           
=======================================
  Files         161      161           
  Lines       51063    51063           
=======================================
  Hits        46365    46365           
  Misses       4698     4698
```

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

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16518?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/16518?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `80.98% <ø> (ø)` | :arrow_up: |

------

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

```diff
@@           Coverage Diff           @@
##           master   #16518   +/-   ##
=======================================
  Coverage   90.79%   90.79%           
=======================================
  Files         161      161           
  Lines       51063    51063           
=======================================
  Hits        46365    46365           
  Misses       4698     4698
```

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

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16518?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/16518?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `80.98% <ø> (ø)` | :arrow_up: |

------

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