• 
      

    Fix deprecation warnings and unittest2 usage in unit tests.

    Review Request #12494 — Created Aug. 2, 2022 and submitted

    Information

    kgb
    master

    Reviewers

    kgb

    We have a number of unit tests that emit warnings, some of which are
    errors in Python 3.11. These largely concern assertRaisesRegexp(),
    inspect.getargspec(), and some bad escaping in test strings.

    This updates all of our assertRaisesRegexp() calls to
    assertRaisesRegex(), adds a decorator to skip tests if
    inspect.getargspec() is not available, and fixes the string escaping.

    This uncovered some bad comparisons that led to unittest2 not being
    used on Python 2.7. Those have been updated to ensure we do properly
    install and use that module.

    Unit tests pass on Python 2.7 through 3.10.

    Summary ID
    Fix deprecation warnings and unittest2 usage in unit tests.
    We have a number of unit tests that emit warnings, some of which are errors in Python 3.11. These largely concern `assertRaisesRegexp()`, `inspect.getargspec()`, and some bad escaping in test strings. This updates all of our `assertRaisesRegexp()` calls to `assertRaisesRegex()`, adds a decorator to skip tests if `inspect.getargspec()` is not available, and fixes the string escaping. This uncovered some bad comparisons that led to `unittest2` not being used on Python 2.7. Those have been updated to ensure we do properly install and use that module.
    8d896f7d21b8bd62ee3e50cf34afa6e639913c7b
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to master (d9906ef)