Skip to content

Commit fca5195

Browse files
veoxcarver
authored andcommitted
tests: Don't consider MiningChain in tests (ethereum#623)
tests: don't parametrise fixture + don't pass unused fixtures to test. Don't parametrise `chain_without_block_validation` + don't pass unused fixtures to `test_rpc_against_fixtures()`.
1 parent 62164b7 commit fca5195

File tree

2 files changed

+4
-21
lines changed

2 files changed

+4
-21
lines changed

tests/conftest.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
from eth_keys import keys
1515

1616
from eth import constants as eth_constants
17-
from eth.chains.base import (
18-
Chain,
19-
MiningChain,
20-
)
17+
from eth.chains.base import Chain
2118
from eth.db.atomic import AtomicDB
2219
# TODO: tests should not be locked into one set of VM rules. Look at expanding
2320
# to all mainnet vms.
@@ -251,9 +248,8 @@ def genesis_state(base_genesis_state):
251248
return base_genesis_state
252249

253250

254-
@pytest.fixture(params=[Chain, MiningChain])
251+
@pytest.fixture
255252
def chain_without_block_validation(
256-
request,
257253
base_db,
258254
genesis_state):
259255
"""
@@ -271,8 +267,7 @@ def chain_without_block_validation(
271267
'validate_block': lambda self, block: None,
272268
}
273269
SpuriousDragonVMForTesting = SpuriousDragonVM.configure(validate_seal=lambda block: None)
274-
chain_class = request.param
275-
klass = chain_class.configure(
270+
klass = Chain.configure(
276271
__name__='TestChainWithoutBlockValidation',
277272
vm_configuration=(
278273
(eth_constants.GENESIS_BLOCK_NUMBER, SpuriousDragonVMForTesting),

tests/json-fixtures-over-rpc/test_rpc_fixtures.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
is_string,
1919
)
2020

21-
from eth.chains.base import (
22-
MiningChain,
23-
)
2421
from eth.chains.mainnet import (
2522
MainnetChain,
2623
)
@@ -384,21 +381,12 @@ def chain_fixture(fixture_data):
384381
return fixture
385382

386383

387-
@pytest.fixture
388-
def chain(chain_without_block_validation):
389-
if isinstance(chain_without_block_validation, MiningChain):
390-
# These tests are long. For RPC state tests, there shouldn't be any
391-
# significant difference between a mining chain and a basic chain.
392-
pytest.skip("Only need to test basic chain")
393-
return
394-
395-
396384
class MainnetFullChain(FullChain):
397385
vm_configuration = MainnetChain.vm_configuration
398386

399387

400388
@pytest.mark.asyncio
401-
async def test_rpc_against_fixtures(chain, event_bus, ipc_server, chain_fixture, fixture_data):
389+
async def test_rpc_against_fixtures(event_bus, chain_fixture, fixture_data):
402390
rpc = RPCServer(
403391
initialize_eth1_modules(MainnetFullChain(None), event_bus)
404392
)

0 commit comments

Comments
 (0)