Conflux-Chain / python-conflux-sdk

Conflux Python SDK
https://python-conflux-sdk.readthedocs.io/en/latest/
14 stars 3 forks source link

Add pytest plugin to suppress web3 activation order in pytest #19

Open darwintree opened 1 year ago

darwintree commented 1 year ago

deploy_hash = construct_c.constructor( os.environ["NAME"], os.environ["SYMBOL"],

c_w3.cfx.contract(name="CrossSpaceCall").address

        'CFXTEST:TYPE.BUILTIN:AAEJUAAAAAAAAAAAAAAAAAAAAAAAAAAAA2EAEG85P5',
    ).transact()

value = 'CFXTEST:TYPE.BUILTIN:AAEJUAAAAAAAAAAAAAAAAAAAAAAAAAAAA2EAEG85P5'

def validate_address(value: Any) -> None:
    """
    Helper function for validating an address
    """
    if is_not_address_string(value):
        if not is_valid_ens_name(value):
          raise InvalidAddress(f"ENS name: '{value}' is invalid.")

E web3.exceptions.InvalidAddress: ENS name: 'CFXTEST:TYPE.BUILTIN:AAEJUAAAAAAAAAAAAAAAAAAAAAAAAAAAA2EAEG85P5' is invalid.

darwintree commented 1 year ago

Add pytest.ini in test root directory

[pytest]
addopts = -p no:pytest_ethereum