BUG: reindex_like after shape comparison
State: closed

in assert_frame_equal, if check_like, the former code reindex_like before shape comparison.
for example:
if left.shape=(2,2), right.shpae=(2.0), after reindex_like, left.shape=(2,0),right.shape=(2,0),then the shape comparison will not find out that the two dataframes are different. For that, the assert_frame_equal will not raise assertion errors. But in fact it should raise.
@jreback 


Labels:
name: Testing
description: pandas testing functions or related to the test suite

Comments:
@jojomdt Thanks for the contribution. We also have tests for our testing infrastructure, so can you add a test for this? (in pandas/tests/test_testing.py)

I suppose your change was the original intended behaviour (@jreback? that is what it is used for in our tests), i.e. to support comparing frames with different row order. But if so, we should clarify that in the docstring of `check_like`, as you can also interpret it that they don't need to have the same shape.
this is probably more correct in that it gives a nicer error if you have s shape mismatch (it works now but will give a value comparison error)

what case did this come up in? (ideally add this to the tests of the testers as joris indicates)
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15496?src=pr&el=h1) Report
> Merging [#15496](https://codecov.io/gh/pandas-dev/pandas/pull/15496?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/b94186d4c58ee055656a84f55618be537db0095a?src=pr&el=desc) will **decrease** coverage by `-0.01%`.
> The diff coverage is `100%`.


```diff
@@            Coverage Diff             @@
##           master   #15496      +/-   ##
==========================================
- Coverage   90.36%   90.36%   -0.01%     
==========================================
  Files         135      135              
  Lines       49519    49519              
==========================================
- Hits        44747    44746       -1     
- Misses       4772     4773       +1
```


| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/15496?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/compare/b94186d4c58ee055656a84f55618be537db0095a...ce7bd745ed84471d10bbd0a5ccee06c077e8b086?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `82.09% <100%> (ø)` | :white_check_mark: |
| [pandas/core/common.py](https://codecov.io/gh/pandas-dev/pandas/compare/b94186d4c58ee055656a84f55618be537db0095a...ce7bd745ed84471d10bbd0a5ccee06c077e8b086?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tbW9uLnB5) | `91.02% <ø> (-0.34%)` | :x: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15496?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/15496?src=pr&el=footer). Last update [b94186d...7b3437b](https://codecov.io/gh/pandas-dev/pandas/compare/b94186d4c58ee055656a84f55618be537db0095a...7b3437b0eb228f020871046754d3bd38492f179e?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
add a test for dataframe with different row order to be equal, simplify shape comparison
@jorisvandenbossche @jreback 
thanks @jojomdt