Skip to content

Commit

Permalink
extend timeout for Futures tests
Browse files Browse the repository at this point in the history
  • Loading branch information
btschwertfeger committed Mar 8, 2024
1 parent c060cac commit 97aaa9b
Showing 1 changed file with 34 additions and 12 deletions.
46 changes: 34 additions & 12 deletions tests/futures/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
FUTURES_SANDBOX_KEY: str = os.getenv("FUTURES_SANDBOX_KEY")
FUTURES_SANDBOX_SECRET_KEY: str = os.getenv("FUTURES_SANDBOX_SECRET")

FUTURES_EXTENDED_TIMEOUT: int = 30


@pytest.fixture()
def futures_api_key() -> str:
Expand All @@ -33,15 +35,19 @@ def futures_market() -> Market:
"""
Fixture providing an unauthenticated Futures Market client
"""
return Market()
market: Market = Market()
market.TIMEOUT = FUTURES_EXTENDED_TIMEOUT
return market


@pytest.fixture()
def futures_auth_market() -> Market:
"""
Fixture providing an authenticated Futures Market client.
"""
return Market(key=FUTURES_API_KEY, secret=FUTURES_SECRET_KEY)
market: Market = Market(key=FUTURES_API_KEY, secret=FUTURES_SECRET_KEY)
market.TIMEOUT = FUTURES_EXTENDED_TIMEOUT
return market


@pytest.fixture()
Expand All @@ -50,11 +56,13 @@ def futures_demo_market() -> Market:
Fixture providing an authenticated Futures Market client that
uses the demo/sandbox environment.
"""
return Market(
market: Market = Market(
key=FUTURES_SANDBOX_KEY,
secret=FUTURES_SANDBOX_SECRET_KEY,
sandbox=True,
)
market.TIMEOUT = FUTURES_EXTENDED_TIMEOUT
return market


@pytest.fixture()
Expand All @@ -63,7 +71,7 @@ def futures_user() -> User:
Fixture providing an unauthenticated Futures User client.
"""
user: User = User()
user.TIMEOUT = 30
user.TIMEOUT = FUTURES_EXTENDED_TIMEOUT
return user


Expand All @@ -73,7 +81,7 @@ def futures_auth_user() -> User:
Fixture providing an authenticated Futures User client.
"""
user: User = User(key=FUTURES_API_KEY, secret=FUTURES_SECRET_KEY)
User.TIMEOUT = 30
User.TIMEOUT = FUTURES_EXTENDED_TIMEOUT
return user


Expand All @@ -83,27 +91,33 @@ def futures_demo_user() -> User:
Fixture providing an authenticated Futures User client that
uses the demo/sandbox environment.
"""
return User(
user: User = User(
key=FUTURES_SANDBOX_KEY,
secret=FUTURES_SANDBOX_SECRET_KEY,
sandbox=True,
)
User.TIMEOUT = FUTURES_EXTENDED_TIMEOUT
return user


@pytest.fixture()
def futures_trade() -> Trade:
"""
Fixture providing an unauthenticated Futures Trade client.
"""
return Trade()
trade: Trade = Trade()
trade.TIMEOUT = FUTURES_EXTENDED_TIMEOUT
return trade


@pytest.fixture()
def futures_auth_trade() -> Trade:
"""
Fixture providing an authenticated Futures Trade client.
"""
return Trade(key=FUTURES_API_KEY, secret=FUTURES_SECRET_KEY)
trade: Trade = Trade(key=FUTURES_API_KEY, secret=FUTURES_SECRET_KEY)
trade.TIMEOUT = FUTURES_EXTENDED_TIMEOUT
return trade


@pytest.fixture()
Expand All @@ -112,27 +126,33 @@ def futures_demo_trade() -> Trade:
Fixture providing an authenticated Futures Trade client that
uses the demo/sandbox environment.
"""
return Trade(
trade: Trade = Trade(
key=FUTURES_SANDBOX_KEY,
secret=FUTURES_SANDBOX_SECRET_KEY,
sandbox=True,
)
trade.TIMEOUT = FUTURES_EXTENDED_TIMEOUT
return trade


@pytest.fixture()
def futures_funding() -> Funding:
"""
Fixture providing an unauthenticated Futures Funding client.
"""
return Funding()
funding: Funding = Funding()
funding.TIMEOUT = FUTURES_EXTENDED_TIMEOUT
return funding


@pytest.fixture()
def futures_auth_funding() -> Funding:
"""
Fixture providing an authenticated Futures Funding client.
"""
return Funding(key=FUTURES_API_KEY, secret=FUTURES_SECRET_KEY)
funding: Funding = Funding(key=FUTURES_API_KEY, secret=FUTURES_SECRET_KEY)
funding.TIMEOUT = FUTURES_EXTENDED_TIMEOUT
return funding


@pytest.fixture()
Expand All @@ -141,8 +161,10 @@ def futures_demo_funding() -> Funding:
Fixture providing an authenticated Futures Funding client that
uses the demo/sandbox environment.
"""
return Funding(
funding: Funding = Funding(
key=FUTURES_SANDBOX_KEY,
secret=FUTURES_SANDBOX_SECRET_KEY,
sandbox=True,
)
funding.TIMEOUT = FUTURES_EXTENDED_TIMEOUT
return funding

0 comments on commit 97aaa9b

Please sign in to comment.