TST: Fixed failures in JSON asserts
State: closed

Fixes an occasional failure in the json tests. They'd fail when the
Series held objects of equal length.

```pytb
pandas/tests/extension/json/test_json.py:114:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pandas/util/testing.py:1224: in assert_series_equal
    _testing.assert_almost_equal(left.get_values(), right.get_values(),
pandas/core/series.py:466: in get_values
    return self._data.get_values()
pandas/core/internals.py:4742: in get_values
    return np.array(self._block.to_dense(), copy=False)
pandas/core/internals.py:1940: in to_dense
    return np.asarray(self.values)
../../Envs/pandas-dev/lib/python3.6/site-packages/numpy/numpy/core/numeric.py:500: in asarray
    return array(a, dtype, copy=False, order=order)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = {'a': 1}, key = 0

    def __getitem__(self, key):
        if key in self.data:
            return self.data[key]
        if hasattr(self.__class__, "__missing__"):
            return self.__class__.__missing__(self, key)
>       raise KeyError(key)
E       KeyError: 0
```

Work around that by converting to dicts before comparing.

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

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

```diff
@@           Coverage Diff           @@
##           master   #20827   +/-   ##
=======================================
  Coverage   91.77%   91.77%           
=======================================
  Files         153      153           
  Lines       49281    49281           
=======================================
  Hits        45230    45230           
  Misses       4051     4051
```

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


------

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

Apologies for the quick self-merge, but I'm going to merge this on green so that https://github.com/pandas-dev/pandas/pull/20814 can be re-run on top if it. This is test-only so I think things are OK.