Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 145c67e

Browse files
committed
fix: late binding issue
1 parent 58cc2ed commit 145c67e

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

ethereum/tests/test_blocks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def do_test_block(filename, testname=None, testdata=None, limit=99999999):
112112
run_block_test(testdata)
113113
else:
114114
fixtures = testutils.get_tests_from_file_or_dir(
115-
os.path.join('fixtures', 'BlockTests'))
115+
os.path.join(testutils.fixture_path, 'BlockTests'))
116116

117117
def mk_test_func(filename, testname, testdata):
118118
return lambda: do_test_block(filename, testname, testdata)

ethereum/tests/test_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def do_test_state(filename, testname=None, testdata=None, limit=99999999):
4040
testutils.check_state_test(testdata)
4141
else:
4242
fixtures = testutils.get_tests_from_file_or_dir(
43-
os.path.join('fixtures', 'StateTests'))
43+
os.path.join(testutils.fixture_path, 'StateTests'))
4444

4545
filenames = sorted(list(fixtures.keys()))
4646
for filename in filenames:

ethereum/tests/test_transactions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ def run_test(filename, testname, testdata):
6262
run_test(filename, testname, testdata)
6363
else:
6464
fixtures = testutils.get_tests_from_file_or_dir(
65-
os.path.join('fixtures', 'TransactionTests'))
66-
for filename, tests in list(fixtures.items()):
65+
os.path.join(testutils.fixture_path, 'TransactionTests'))
6766

68-
def mk_test_func(filename, testname, testdata):
69-
return lambda: run_test(filename, testname, testdata)
67+
def mk_test_func(filename, testname, testdata):
68+
return lambda: run_test(filename, testname, testdata)
7069

70+
for filename, tests in list(fixtures.items()):
7171
for testname, testdata in list(tests.items()):
7272
func_name = 'test_%s_%s' % (filename, testname)
7373
globals()[func_name] = mk_test_func(filename, testname, testdata)

ethereum/tests/test_vm.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,12 @@ def do_test_vm(filename, testname=None, testdata=None, limit=99999999):
3434
testutils.check_vm_test(testdata)
3535
else:
3636
fixtures = testutils.get_tests_from_file_or_dir(
37-
os.path.join('fixtures', 'VMTests'))
37+
os.path.join(testutils.fixture_path, 'VMTests'))
3838

3939
def mk_test_func(filename, testname, testdata):
4040
return lambda: do_test_vm(filename, testname, testdata)
4141

4242
for filename, tests in list(fixtures.items()):
4343
for testname, testdata in list(tests.items()):
4444
func_name = 'test_%s_%s' % (filename, testname)
45-
4645
globals()[func_name] = mk_test_func(filename, testname, testdata)

ethereum/testutils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
check_ethash_test = lambda params: run_ethash_test(params, VERIFY)
3939
time_ethash_test = lambda params: run_ethash_test(params, TIME)
4040

41+
fixture_path = os.path.join(os.path.dirname(__file__), '..', 'fixtures')
4142

4243
def parse_int_or_hex(s):
4344
if s[:2] == b'0x':

0 commit comments

Comments
 (0)