TST: correct constructor in extension array tests
State: closed

Replace `type(data)(..)` with `data._constructor_from_sequence`. 

A bit annoying the name is that long :-), but this is the correct usage.

cc @TomAugspurger 

Labels:
name: ExtensionArray
description: Extending pandas with custom dtypes or arrays.

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

```diff
@@            Coverage Diff             @@
##           master   #20746      +/-   ##
==========================================
- Coverage   91.85%   91.84%   -0.01%     
==========================================
  Files         153      153              
  Lines       49308    49303       -5     
==========================================
- Hits        45290    45284       -6     
- Misses       4018     4019       +1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.23% <ø> (-0.01%)` | :arrow_down: |
| #single | `41.89% <ø> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/20746?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/internals.py](https://codecov.io/gh/pandas-dev/pandas/pull/20746/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW50ZXJuYWxzLnB5) | `95.53% <0%> (-0.05%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/20746/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.16% <0%> (-0.01%)` | :arrow_down: |
| [pandas/core/arrays/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/20746/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2Jhc2UucHk=) | `84.14% <0%> (ø)` | :arrow_up: |
| [pandas/core/resample.py](https://codecov.io/gh/pandas-dev/pandas/pull/20746/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzYW1wbGUucHk=) | `96.43% <0%> (ø)` | :arrow_up: |
| [pandas/core/indexes/datetimelike.py](https://codecov.io/gh/pandas-dev/pandas/pull/20746/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZWxpa2UucHk=) | `96.72% <0%> (ø)` | :arrow_up: |
| [pandas/core/indexing.py](https://codecov.io/gh/pandas-dev/pandas/pull/20746/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhpbmcucHk=) | `93.08% <0%> (ø)` | :arrow_up: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/20746/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `95.94% <0%> (ø)` | :arrow_up: |
| [pandas/tseries/offsets.py](https://codecov.io/gh/pandas-dev/pandas/pull/20746/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvb2Zmc2V0cy5weQ==) | `97% <0%> (ø)` | :arrow_up: |

------

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

why dont we rename to ``_from_sequence``?
I think we can certainly leave out the `constructor` part. For `_from_scalars` or `_from_sequence`, the doesn't indicate it is from a list/array of scalars, and the second does not indicate that it is from the dtype's scalar objects. 
I personally have a preference for `_from_scalars` because I find the 'scalar' the more important information of the two, but `_from_sequence` is certainly already an improvement compared to the current name.
Either of those are fine. Slight preference for `_from_scalars`, for the
reasons Joris outlined. But from the context, I think it's clear enough
what `_from_sequence` is doing.

On Fri, Apr 20, 2018 at 2:13 AM, Joris Van den Bossche <
notifications@github.com> wrote:

> I think we can certainly leave out the constructor part. For _from_scalars
> or _from_sequence, the doesn't indicate it is from a list/array of
> scalars, and the second does not indicate that it is from the dtype's
> scalar objects.
> I personally have a preference for _from_scalars because I find the
> 'scalar' the more important information of the two, but _from_sequence is
> certainly already an improvement compared to the current name.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/20746#issuecomment-383003930>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABQHIs7TwlIFipdK_GOKnyUkwkcxIWCrks5tqYqpgaJpZM4Tb6xW>
> .
>

let's do the rename to ``_from_sequence`` in this PR (and update docs etc)
The Appveyor failure was an HTTP issue. @jorisvandenbossche you can merge whenever.