This repository was archived by the owner on Feb 17, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 22import requests
33from dotenv import load_dotenv
44from typing import List , Optional , Union
5- from utils import HexIntStringNumber
5+ from . utils import HexIntStringNumber
66from .errors import NO_API_KEY_ERROR
77from .networks import Network
88
Original file line number Diff line number Diff line change 1- from alchemy_sdk_py import Alchemy
21import os
32import pytest
3+ from alchemy_sdk_py import Alchemy
4+ from _pytest .monkeypatch import MonkeyPatch
45
56
67def test_initialize_empty_network (dummy_api_key , mock_env_missing ):
@@ -38,10 +39,8 @@ def test_api_key_property(dummy_api_key):
3839 assert alchemy .key == dummy_api_key
3940
4041
41- def test_key_with_environment_variable ():
42+ def test_key_with_environment_variable (monkeypatch : MonkeyPatch ):
4243 test_key = "test_key"
43- original_value = os .environ ["ALCHEMY_API_KEY" ]
44- os .environ ["ALCHEMY_API_KEY" ] = test_key
44+ monkeypatch .setenv ("ALCHEMY_API_KEY" , test_key )
4545 alchemy = Alchemy ()
4646 assert alchemy .key == test_key
47- os .environ ["ALCHEMY_API_KEY" ] = original_value
You can’t perform that action at this time.
0 commit comments