Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some tweaks to testing framework. #4594

Merged
merged 1 commit into from
Sep 11, 2024

Commits on Sep 10, 2024

  1. Some tweaks to testing framework.

    Most interesting is an "api change" - the test methods test.must_exist()
    and test.must_exist_one_of() now take an optional 'message' keyword
    argument which is passed on to fail_test() if the test fails.
    
    The regex used to test an exception is now working for Python 3.13,
    and enabled conditionally - the "enhanced error reporting" changed, in
    a way that made it easy to reuse the existing regex (if somebody wants
    to take a shot at unifying them, more power!).
    
    Also one unexpected issue was found - one of the check routines does
    "output = os.newline.join(output)", but there is no os.newline.  Could use
    os.linesep, but just changed it to the Python newline character.
    
    Some annotations added, and some cleanup done on possibly unsafe uses
    - mainly that self.stderr() and selt.stdout() *can* return None, but
    several places in the code just did string operations on the return
    unconditionally. There's already precendent- other places did do a check
    before using, so just extended the concept to possibly vulnerable palces.
    
    Signed-off-by: Mats Wichmann <[email protected]>
    mwichmann committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    569f24a View commit details
    Browse the repository at this point in the history