Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
be safe w cleanup in test fixture
Signed-off-by: Rob Howley <howley.robert@gmail.com>
  • Loading branch information
robhowley committed Oct 24, 2024
commit f50c6cb68101b1937120ed470ba764a849d82f5c
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ def test_get_online_features(python_fs_client):
async def test_push(python_fs_client):
initial_temp = await _get_temperatures_from_feature_server(
python_fs_client, location_ids=[1]
)[0]
)
json_data = json.dumps(
{
"push_source_name": "location_stats_push_source",
"df": {
"location_id": [1],
"temperature": [initial_temp * 100],
"temperature": [initial_temp[0] * 100],
"event_timestamp": [str(_utc_now())],
"created": [str(_utc_now())],
},
Expand All @@ -82,9 +82,10 @@ async def test_push(python_fs_client):

# Check new pushed temperature is fetched
assert response.status_code == 200
assert await _get_temperatures_from_feature_server(
actual = await _get_temperatures_from_feature_server(
python_fs_client, location_ids=[1]
) == [initial_temp * 100]
)
assert actual == [initial_temp[0] * 100]


@pytest.mark.integration
Expand Down Expand Up @@ -142,5 +143,7 @@ def python_fs_client(environment, universal_data_sources, request):
loop = asyncio.get_event_loop()
loop.run_until_complete(fs.initialize())
client = TestClient(get_app(fs))
yield client
loop.run_until_complete(fs.close())
try:
yield client
finally:
loop.run_until_complete(fs.close())