Skip to content

Commit 5602f72

Browse files
committed
Output state errors more clearly
Errors from blockchain fixtures were being swallowed silently. Output these along with a full stack trace to make debugging easier.
1 parent cceb72b commit 5602f72

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/json-fixtures/test_state.py

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import pytest
44

5+
import traceback
6+
57
from eth_keys import keys
68

79
from evm.db import (
@@ -43,13 +45,18 @@
4345
should_run_slow_tests,
4446
)
4547

48+
from tests.conftest import vm_logger
49+
4650

4751
ROOT_PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
4852

4953

5054
BASE_FIXTURE_PATH = os.path.join(ROOT_PROJECT_DIR, 'fixtures', 'GeneralStateTests')
5155

5256

57+
LOGGER = vm_logger()
58+
59+
5360
@to_tuple
5461
def expand_fixtures_forks(all_fixtures):
5562
"""
@@ -295,6 +302,8 @@ def test_state_fixtures(fixture, fixture_vm_class):
295302
computation, _ = vm.apply_transaction(transaction)
296303
except ValidationError as err:
297304
transaction_error = err
305+
LOGGER.warn("Got transaction error:")
306+
LOGGER.warn(traceback.format_exc())
298307
else:
299308
transaction_error = False
300309

0 commit comments

Comments
 (0)