• 
      

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

    Review Request #12154 — Created March 15, 2022 and submitted

    Information

    Review Board
    release-5.0.x

    Reviewers

    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.

    All unit tests pass without subvertpy installed.

    Summary ID
    Fix test state leakages causing failures if subvertpy isn't installed.
    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.
    174c489745553027f942f7291623ea3062da35ef
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-5.0.x (8f7c4c1)