diff --git a/cschwabpy/models/__init__.py b/cschwabpy/models/__init__.py index 29d6f84..6459efa 100644 --- a/cschwabpy/models/__init__.py +++ b/cschwabpy/models/__init__.py @@ -203,7 +203,7 @@ class Market(JSONSerializableBaseModel): product: str productName: str isOpen: bool - sessionHours: SessionHours + sessionHours: Optional[SessionHours] = None class EquityMarket(JSONSerializableBaseModel): diff --git a/tests/test_models.py b/tests/test_models.py index de566ad..d20ee5b 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -97,6 +97,7 @@ async def test_market_hours(httpx_mock: HTTPXMock) -> None: all_market = MarketHourInfo(**all_market_json) assert all_market is not None assert all_market.equity is not None + assert all_market.equity.EQ.sessionHours is not None assert all_market.equity.EQ.sessionHours.regularMarket is not None assert all_market.equity.EQ.sessionHours.preMarket is not None