Add tests in methods.py
State: closed

Closes #23241



Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: ExtensionArray
description: Extending pandas with custom dtypes or arrays.

Comments:
Hello @thoo! Thanks for updating the PR.

 - There are no PEP8 issues in the file [`pandas/tests/extension/base/methods.py`](https://github.com/thoo/pandas/blob/6cee6c63b69981cd15c379619da865497f02c54a/pandas/tests/extension/base/methods.py) !

 - There are no PEP8 issues in the file [`pandas/tests/extension/decimal/test_decimal.py`](https://github.com/thoo/pandas/blob/6cee6c63b69981cd15c379619da865497f02c54a/pandas/tests/extension/decimal/test_decimal.py) !

 - There are no PEP8 issues in the file [`pandas/tests/extension/json/test_json.py`](https://github.com/thoo/pandas/blob/6cee6c63b69981cd15c379619da865497f02c54a/pandas/tests/extension/json/test_json.py) !

 - There are no PEP8 issues in the file [`pandas/tests/extension/test_categorical.py`](https://github.com/thoo/pandas/blob/6cee6c63b69981cd15c379619da865497f02c54a/pandas/tests/extension/test_categorical.py) !

 - There are no PEP8 issues in the file [`pandas/tests/extension/test_integer.py`](https://github.com/thoo/pandas/blob/6cee6c63b69981cd15c379619da865497f02c54a/pandas/tests/extension/test_integer.py) !

 - There are no PEP8 issues in the file [`pandas/tests/extension/test_interval.py`](https://github.com/thoo/pandas/blob/6cee6c63b69981cd15c379619da865497f02c54a/pandas/tests/extension/test_interval.py) !

 - There are no PEP8 issues in the file [`pandas/tests/extension/test_sparse.py`](https://github.com/thoo/pandas/blob/6cee6c63b69981cd15c379619da865497f02c54a/pandas/tests/extension/test_sparse.py) !



##### Comment last updated on October 21, 2018 at 04:29 Hours UTC
@TomAugspurger I am not sure how to work on `fillna raises when passed an array of the wrong length`. Is it passing an array to fill like `df.fillna(array)`?? Dataframe and Series won't take `array` but `ExtensionArray` take `array`. Please let me know where I should start. Thanks.
Something like

```
with tm.assert_raises_regex(ValueError, msg):
    data_missing.fillna(data_missing.take([1])
```

That will try filling a length-2 EA with a length-1 EA, which should raise.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23261?src=pr&el=h1) Report
> Merging [#23261](https://codecov.io/gh/pandas-dev/pandas/pull/23261?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/a2e599499667b256bc5b8b13a75f0601eccfd432?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #23261      +/-   ##
==========================================
+ Coverage   92.18%   92.18%   +<.01%     
==========================================
  Files         161      161              
  Lines       51184    51184              
==========================================
+ Hits        47185    47186       +1     
+ Misses       3999     3998       -1
```

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

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/23261?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/arrays/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/23261/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2Jhc2UucHk=) | `98.01% <0%> (+0.66%)` | :arrow_up: |

------

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

> Something like
> 
> ```
> with tm.assert_raises_regex(ValueError, msg):
>     data_missing.fillna(data_missing.take([1])
> ```
> That will try filling a length-2 EA with a length-1 EA, which should raise.

This is not working on `categories`, `sparse array` and `Interval` as `value" parameter must be a scalar, dict or Series,`. Should I skip these tests? I have four of them failing. Thanks.
Yes, I think those don't implement `fillna(array)`. Check for other skips in those files.
thanks @thoo