CCI-MOC / flocx-market

2 stars 9 forks source link

test_matcher has too many tests inside a `with raises ...` block #27

Closed larsks closed 5 years ago

larsks commented 5 years ago

The final test in test_matcher.py has two tests inside a with raises ... block (https://github.com/CCI-MOC/flocx-market/blob/master/flocx_market/tests/unit/test_matcher.py#L169):

def test_invalid_data_type():
    with raises(ValueError):
        exp = [["inventory.memory.physical_mb", "<=", "755-*37"]]
        match_specs(exp, data)
        exp = [["inventory.system_vendor.product_name", "endswith", ["M620"]]]
        match_specs(exp, data)

The second test will never run (because the exception raised by the first call to match_specs will exit the with raises block.