Skip to content

Commit

Permalink
try setting event loop in the fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
conbrad committed Sep 22, 2023
1 parent 9351e21 commit fec4260
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 2 additions & 0 deletions api/app/tests/jobs/job_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def mock_wfwx_stations():
station_2 = WFWXWeatherStation(latitude=1, longitude=1, elevation=1,
wfwx_id='ba28973a-0a79-04ea-e053-1d09228e8c65', code=2,
name='blah', zone_code='T1')
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)

future_wfwx_stations = asyncio.Future()
future_wfwx_stations.set_result([station_1, station_2])
Expand Down
3 changes: 0 additions & 3 deletions api/app/tests/jobs/test_noon_forecasts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
""" Unit tests for the fireweather noon forecats job """
import asyncio
import os
import logging
import pytest
Expand All @@ -14,8 +13,6 @@
@pytest.fixture()
def mock_noon_forecasts(mocker: MockerFixture):
""" Mocks out noon forecasts as async result """
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
wfwx_hourlies = mock_wfwx_response()
future_wfwx_stations = mock_wfwx_stations()

Expand Down

0 comments on commit fec4260

Please sign in to comment.