googleapis / sample-tester

Tool for testing semantically equivalent samples in multiple languages and environments
Apache License 2.0
10 stars 12 forks source link

testplans with no/empty setup/teardown cause errors #134

Closed vchudnov-g closed 5 years ago

vchudnov-g commented 5 years ago

If the testplan does not have setup, then we get the error:

INFO:root:    | 
    | ### Test case SETUP
    | 
    | ### Test case TEST
    | # EXCEPTION!! TypeError("__init__() missing 1 required positional argument: 'msg'",)
    | 
    | ### Test case TEARDOWN
    | 

If the testplan has an empty setup/tear down, then we get the error:


INFO:root:    Output:
INFO:root:    | 
    | ### Test case SETUP
    | # EXCEPTION!! TypeError("'NoneType' object is not iterable",)
    | 
    | ### Test case TEARDOWN
    | # EXCEPTION!! TypeError("'NoneType' object is not iterable",)
    | 

Here's the config that can be used to play around with this.

vchudnov-g commented 5 years ago

The first error is due to a ConfigError not being passed a value.

That speaks to something else: user errors like ConfigErrors should be displayed nicely. Non-user exceptions should be moderately detailed, possibly with a stack trace (at least when debugging).