fix test tooling bug
This commit is contained in:
parent
3189cf0079
commit
a39623a95a
|
@ -14,11 +14,14 @@ def spec_state_test(fn):
|
||||||
|
|
||||||
|
|
||||||
def expect_assertion_error(fn):
|
def expect_assertion_error(fn):
|
||||||
|
bad = False
|
||||||
try:
|
try:
|
||||||
fn()
|
fn()
|
||||||
raise AssertionError('expected an assertion error, but got none.')
|
bad = True
|
||||||
except AssertionError:
|
except AssertionError:
|
||||||
pass
|
pass
|
||||||
except IndexError:
|
except IndexError:
|
||||||
# Index errors are special; the spec is not explicit on bound checking, an IndexError is like a failed assert.
|
# Index errors are special; the spec is not explicit on bound checking, an IndexError is like a failed assert.
|
||||||
pass
|
pass
|
||||||
|
if bad:
|
||||||
|
raise AssertionError('expected an assertion error, but got none.')
|
||||||
|
|
Loading…
Reference in New Issue