From 6a2e3e1a2455e595481065fb350226b8790455da Mon Sep 17 00:00:00 2001 From: Simon Bihel Date: Tue, 8 Oct 2024 16:11:10 +0100 Subject: [PATCH] fixup! Fix tests --- tests/test_siwe.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/test_siwe.py b/tests/test_siwe.py index 2861205..10536f6 100644 --- a/tests/test_siwe.py +++ b/tests/test_siwe.py @@ -23,6 +23,11 @@ with open(BASE_TESTS + "eip1271.json", "r") as f: verification_eip1271 = decamelize(json.load(fp=f)) +try: + endpoint_uri = os.environ["WEB3_PROVIDER_URI"] +except KeyError: + endpoint_uri = "https://cloudflare-eth.com" + class TestMessageParsing: @pytest.mark.parametrize("abnf", [True, False]) @@ -85,16 +90,12 @@ def test_valid_message(self, test_name, test): def test_eip1271_message(self, test_name, test): if test_name == "loopring": pytest.skip() - try: - endpoint_uri = os.environ["WEB3_PROVIDER_URI"] - except KeyError: - endpoint_uri = "https://cloudflare-eth.com" provider = HTTPProvider(endpoint_uri=endpoint_uri) siwe_message = SiweMessage.from_message(message=test["message"]) siwe_message.verify(test["signature"], provider=provider) @pytest.mark.parametrize( - "provider", [HTTPProvider(endpoint_uri="https://cloudflare-eth.com"), None] + "provider", [HTTPProvider(endpoint_uri=endpoint_uri), None] ) @pytest.mark.parametrize( "test_name,test",