[EncoderDecoder Tests] Improve tests
Author: patrickvonplaten
Pull request: yes

Currently when executing:
``pytest tests/test_modeling_encoder_decoder.py`` all BERT tests are run as well due to problems with the import of BertModelTester (see PR #3383). 

This PR takes the PR: #4027 and does some minimal changes in the encoder decoder test file.

I think @sshleifer found a great solution to circumvent that by moving the `BertModelTester` class out of the BertModelTest class.

What do you think @julien-c , @LysandreJik ? 

Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4046?src=pr&el=h1) Report
> Merging [#4046](https://codecov.io/gh/huggingface/transformers/pull/4046?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/6af3306a1da0322f58861b1fbb62ce5223d97b8a&el=desc) will **increase** coverage by `0.01%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/4046/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/4046?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #4046      +/-   ##
==========================================
+ Coverage   78.84%   78.85%   +0.01%     
==========================================
  Files         114      114              
  Lines       18689    18689              
==========================================
+ Hits        14735    14737       +2     
+ Misses       3954     3952       -2     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/4046?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4046/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `92.93% <0.00%> (+0.16%)` | :arrow_up: |
| [src/transformers/file\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4046/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9maWxlX3V0aWxzLnB5) | `73.55% <0.00%> (+0.41%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/4046?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/huggingface/transformers/pull/4046?src=pr&el=footer). Last update [6af3306...0ed64db](https://codecov.io/gh/huggingface/transformers/pull/4046?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


By the way, do you guys want to do this for all other ModelTester objects @patrickvonplaten and @sshleifer? And maybe (if relevant) define a common abstract class they inherit from?

> By the way, do you guys want to do this for all other ModelTester objects @patrickvonplaten and @sshleifer? And maybe (if relevant) define a common abstract class they inherit from?

I think this would be a good idea. We can probably clean up the tests a lot this way! I will note it down on my To-Do-List

LMK if you want to split it up @patrickvonplaten 

> LMK if you want to split it up @patrickvonplaten

I tihnk I won't find time in the next 2 weeks to do this - feel free to start working on it if you want :-)