• kiilerix's avatar
    assert: try to show some relevant value when an assert fails · 54976f208547
    kiilerix authored
    Debugging and print statements can tell more about failing asserts, but it is
    nice to get *some* information up front, also to make it easier to reproduce.
    
    General guidelines:
    
    Try to avoid anything that must compute something and thus can fail - try to
    just inspect local variables (or whatever assert looked at).
    
    For type related asserts, try to add repr().
    
    Sometimes, multiple variables are relevant - in that case use tuples.
    54976f208547
wconfig_test.py 11.3 KB