- tests = [('', []),
- ('s', ['foo']),
- ('ss', ['foo', 'bar']),
- ('sV', ['foo', 0]),
- ('sv', ['foo', -1]),
- ('V', [0]),
- ('Vs', [0, 'foo']),
- ('VV', [0, 1]),
- ('Vv', [0, -1]),
- ('v', [0]),
- ('vs', [0, 'foo']),
- ('vV', [0, 1]),
- ('vv', [0, -1])]
- for test in tests:
- (types, values) = test
- WVPASSEQ(pack_and_unpack(types, *values), values)
- WVEXCEPT(Exception, vint.pack, 's')
- WVEXCEPT(Exception, vint.pack, 's', 'foo', 'bar')
- WVEXCEPT(Exception, vint.pack, 'x', 1)
- WVEXCEPT(Exception, vint.unpack, 's', '')
- WVEXCEPT(Exception, vint.unpack, 'x', '')
+ with no_lingering_errors():
+ tests = [('', []),
+ ('s', ['foo']),
+ ('ss', ['foo', 'bar']),
+ ('sV', ['foo', 0]),
+ ('sv', ['foo', -1]),
+ ('V', [0]),
+ ('Vs', [0, 'foo']),
+ ('VV', [0, 1]),
+ ('Vv', [0, -1]),
+ ('v', [0]),
+ ('vs', [0, 'foo']),
+ ('vV', [0, 1]),
+ ('vv', [0, -1])]
+ for test in tests:
+ (types, values) = test
+ WVPASSEQ(pack_and_unpack(types, *values), values)
+ WVEXCEPT(Exception, vint.pack, 's')
+ WVEXCEPT(Exception, vint.pack, 's', 'foo', 'bar')
+ WVEXCEPT(Exception, vint.pack, 'x', 1)
+ WVEXCEPT(Exception, vint.unpack, 's', '')
+ WVEXCEPT(Exception, vint.unpack, 'x', '')