diff --git a/tests/core/middleware/test_name_to_address_middleware.py b/tests/core/middleware/test_name_to_address_middleware.py index b6e4408893..6e9e964852 100644 --- a/tests/core/middleware/test_name_to_address_middleware.py +++ b/tests/core/middleware/test_name_to_address_middleware.py @@ -52,5 +52,5 @@ def test_fail_name_resolver(w3): 'net_version': '2', }) w3.middleware_stack.inject(return_chain_on_mainnet, layer=0) - with pytest.raises(InvalidAddress, match='.*ethereum\.eth.*'): + with pytest.raises(InvalidAddress, match=r'.*ethereum\.eth.*'): w3.eth.getBalance("ethereum.eth") diff --git a/web3/_utils/hypothesis.py b/web3/_utils/hypothesis.py index 920c94d8a0..88ee8d1f50 100644 --- a/web3/_utils/hypothesis.py +++ b/web3/_utils/hypothesis.py @@ -4,4 +4,4 @@ def hexstr_strategy(): - return st.from_regex('\A(0[xX])?[0-9a-fA-F]*\Z') + return st.from_regex(r'\A(0[xX])?[0-9a-fA-F]*\Z')