read_excel and Excel File Engine conflict
State: closed

- [x] closes #26566
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry 

cc. @WillAyd 

Note I only decided to raise an error when the engine specified to `read_excel` was different to that of the ExcelFile - otherwise around 15 test cases would need to be changed - let me know what you think


Labels:
name: Error Reporting
description: Incorrect or improved errors from pandas
name: IO Excel
description: read_excel, to_excel

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

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

```diff
@@            Coverage Diff             @@
##           master   #26736      +/-   ##
==========================================
- Coverage   91.78%   91.77%   -0.01%     
==========================================
  Files         174      174              
  Lines       50703    50706       +3     
==========================================
- Hits        46538    46537       -1     
- Misses       4165     4169       +4
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.37% <100%> (ø)` | :arrow_up: |
| #single | `41.8% <0%> (-0.09%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26736?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/excel/\_base.py](https://codecov.io/gh/pandas-dev/pandas/pull/26736/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2V4Y2VsL19iYXNlLnB5) | `91.92% <100%> (+0.11%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26736/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `78.94% <0%> (-10.53%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26736/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.88% <0%> (-0.12%)` | :arrow_down: |

------

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

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

```diff
@@            Coverage Diff             @@
##           master   #26736      +/-   ##
==========================================
- Coverage   91.71%   91.71%   -0.01%     
==========================================
  Files         178      178              
  Lines       50771    50774       +3     
==========================================
  Hits        46567    46567              
- Misses       4204     4207       +3
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.31% <100%> (ø)` | :arrow_up: |
| #single | `41.21% <0%> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26736?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/excel/\_base.py](https://codecov.io/gh/pandas-dev/pandas/pull/26736/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2V4Y2VsL19iYXNlLnB5) | `91.92% <100%> (+0.11%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26736/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `78.94% <0%> (-10.53%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26736/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.88% <0%> (-0.12%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/26736/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `90.94% <0%> (+0.1%)` | :arrow_up: |

------

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

FYI not necessarily going to cause merge conflicts I think but I also just opened #26740. Depending on which merges first we may need to move the test added here around
Can you merge master? Just changed around the structure of the tests I think you should move the new test to the one specific to TestExcelFileRead
Thanks @WillAyd -the new structure is great btw really splits up the excel tests nicely!
thanks @alimcmaster1