[bugfix] Update TestAPIMWException
[bugfix] Update TestAPIMWException

- Do not have tests in tearDown
- update test_API_error

Bug: T264096
Change-Id: If33fcd52f16f832a020894f4975f1c060dd9f9b4

wikimedia/pywikibot-core,wikimedia/pywikibot-core