Skip to content

Commit

Permalink
remove web3(request) fixture
Browse files Browse the repository at this point in the history
removes web3(request) fixture from test_contract_buildTransaction.py
  • Loading branch information
tmckenzie51 committed Oct 29, 2020
1 parent 7c9739b commit 8d51484
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 53 deletions.
27 changes: 0 additions & 27 deletions tests/core/contracts/test_contract_buildTransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,13 @@
dissoc,
)

from web3 import Web3
from web3.exceptions import (
ValidationError,
)
from web3.middleware import (
local_filter_middleware,
)
from web3.providers.eth_tester import (
EthereumTesterProvider,
)

# -*- coding: utf-8 -*-


# Ignore warning in pyethereum 1.6 - will go away with the upgrade
pytestmark = pytest.mark.filterwarnings("ignore:implicit cast from 'char *'")


# Ignore warning in pyethereum 1.6 - will go away with the upgrade
pytestmark = pytest.mark.filterwarnings("ignore:implicit cast from 'char *'")


@pytest.fixture(
params=[True, False],
ids=["local_filter_middleware", "node_based_filter"])
def web3(request):
use_filter_middleware = request.param
provider = EthereumTesterProvider()
w3 = Web3(provider)
if use_filter_middleware:
w3.middleware_onion.add(local_filter_middleware)
return w3


@pytest.fixture()
def math_contract(web3, MathContract, address_conversion_func):
deploy_txn = MathContract.constructor().transact()
Expand Down
1 change: 1 addition & 0 deletions tests/core/filtering/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def tester_snapshot(web3):


@pytest.fixture(
scope='function',
params=[True, False],
ids=["local_filter_middleware", "node_based_filter"])
def web3(request):
Expand Down
3 changes: 0 additions & 3 deletions tests/core/filtering/test_contract_data_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
EthereumTesterProvider,
)

# Ignore warning in pyethereum 1.6 - will go away with the upgrade
pytestmark = pytest.mark.filterwarnings("ignore:implicit cast from 'char *'")


@pytest.fixture(
scope="module",
Expand Down
23 changes: 0 additions & 23 deletions tests/core/filtering/test_contract_on_event_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,6 @@
is_address,
)

from web3 import Web3
from web3.middleware import (
local_filter_middleware,
)
from web3.providers.eth_tester import (
EthereumTesterProvider,
)

# Ignore warning in pyethereum 1.6 - will go away with the upgrade
pytestmark = pytest.mark.filterwarnings("ignore:implicit cast from 'char *'")


@pytest.fixture(
params=[True, False],
ids=["local_filter_middleware", "node_based_filter"])
def web3(request):
use_filter_middleware = request.param
provider = EthereumTesterProvider()
w3 = Web3(provider)
if use_filter_middleware:
w3.middleware_onion.add(local_filter_middleware)
return w3


@pytest.mark.parametrize('call_as_instance', (True, False))
def test_create_filter_address_parameter(web3, emitter, Emitter, call_as_instance):
Expand Down

0 comments on commit 8d51484

Please sign in to comment.