From a39623a95ad56bfe9590969f89fbeedf8a1df1e5 Mon Sep 17 00:00:00 2001 From: protolambda Date: Sat, 11 May 2019 17:51:02 +0200 Subject: [PATCH] fix test tooling bug --- test_libs/pyspec/eth2spec/test/context.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test_libs/pyspec/eth2spec/test/context.py b/test_libs/pyspec/eth2spec/test/context.py index 408b7f867..afabd4a57 100644 --- a/test_libs/pyspec/eth2spec/test/context.py +++ b/test_libs/pyspec/eth2spec/test/context.py @@ -14,11 +14,14 @@ def spec_state_test(fn): def expect_assertion_error(fn): + bad = False try: fn() - raise AssertionError('expected an assertion error, but got none.') + bad = True except AssertionError: pass except IndexError: # Index errors are special; the spec is not explicit on bound checking, an IndexError is like a failed assert. pass + if bad: + raise AssertionError('expected an assertion error, but got none.')