DEP: add pytest-mock to environment.yml
State: closed

Ran into errors when trying to run the test suite in a freshly installed conda environment. There's an error being caused by the fact that #25346 added `pytest-mock` as a dependency in all the CI jobs (to be able to use the `mocker` fixture), but didn't adapt `environment.yml`. This PR fixes that.


Labels:
name: Dependencies
description: Required and optional dependencies

Comments:
ok thanks
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25417?src=pr&el=h1) Report
> Merging [#25417](https://codecov.io/gh/pandas-dev/pandas/pull/25417?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/fbe67d5ce06d6d3766beec1c38dceca89e6ca942?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #25417      +/-   ##
==========================================
- Coverage   91.73%   91.73%   -0.01%     
==========================================
  Files         173      173              
  Lines       52845    52845              
==========================================
- Hits        48480    48479       -1     
- Misses       4365     4366       +1
```

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

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

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25417?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/25417?src=pr&el=footer). Last update [fbe67d5...0a65080](https://codecov.io/gh/pandas-dev/pandas/pull/25417?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/25417?src=pr&el=h1) Report
> Merging [#25417](https://codecov.io/gh/pandas-dev/pandas/pull/25417?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/f2fbebdf7b8da3d354d3957ba5e87d736849aa15?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #25417      +/-   ##
==========================================
- Coverage   91.73%   91.73%   -0.01%     
==========================================
  Files         173      173              
  Lines       52845    52845              
==========================================
- Hits        48480    48479       -1     
- Misses       4365     4366       +1
```

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

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

------

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

thanks
Do we want this as a "required" test dependency?

Also, why was pytest-mock needed? Was something not working with unittest.mock?
this is already added 

unittest.mock is not always available PY2 and is not useful with pytest (gets was broken)
What's "gets"?

Previously, we had a mock fixture that provided unittest.mock if it was
present, and skipped if not (py2).

From the diff in https://github.com/pandas-dev/pandas/pull/25346/files it
doesn't seem like we're using any of the pytest-specific features of
pytest-mock.
OK to revert those and just use unittest.mock when we drop python 2?



On Thu, Mar 7, 2019 at 11:04 AM Jeff Reback <notifications@github.com>
wrote:

> this is already added
>
> unittest.mock is not always available PY2 and is not useful with pytest
> (gets was broken)
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/25417#issuecomment-470609395>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABQHIkFuCvP_bX4q6I-lp3UxeZiQJBNHks5vUUaegaJpZM4bMvu->
> .
>