Fix test state leakages causing failures if subvertpy isn't installed.

Review Request #2435 — Created March 16, 2022 and updated

guest1491
Review Board
8f7c4c1...
guest1491
The SVN unit tests change the test backend in `setUp()`, and restore the
old state in `tearDown()`. Or, they're supposed to. If a backend isn't
installed (such as `subvertpy` on Python 3.8+), we raise a `SkipTest`.
This actually bypasses `tearDown()`, meaning we keep the old test
settings.

This eventually impacts other tests that depend on a working SVN
backend.

We now handle the management of the backend in `setUpClass()` and
`tearDownClass()`, which won't be affected by the `SkipTest`. This
reduces the work that needs to be done per-test, and ensures we'll end
up with the original state once the tests have completed.

Testing Done:
All unit tests pass without `subvertpy` installed.

Reviewed at https://reviews.reviewboard.org/r/12154/


guest1491
guest1491
Review request changed

Status: Re-opened

Loading...