File tree Expand file tree Collapse file tree
extensions/cpp/topstep/cython/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,8 +21,18 @@ async def token(client):
2121 password = os .environ .get ("QUANUX_TOPSTEP__PASSWORD" )
2222 api_key = os .environ .get ("QUANUX_TOPSTEP__API_KEY" )
2323
24+ # Fallback to Keyring
25+ if not username :
26+ try :
27+ import keyring
28+ username = keyring .get_password ("QuanuX" , "QUANUX_TOPSTEP__USERNAME" )
29+ password = keyring .get_password ("QuanuX" , "QUANUX_TOPSTEP__PASSWORD" )
30+ api_key = keyring .get_password ("QuanuX" , "QUANUX_TOPSTEP__API_KEY" )
31+ except ImportError :
32+ pass
33+
2434 if not username or not api_key :
25- pytest .skip ("Missing Topstep credentials (QUANUX_TOPSTEP__USERNAME/API_KEY )" )
35+ pytest .skip ("Missing Topstep credentials (Env: QUANUX_TOPSTEP__* or Keyring: QuanuX )" )
2636
2737 token = await client .login (username , password or "" , api_key )
2838 return token
You can’t perform that action at this time.
0 commit comments