Skip to content

Commit 4ee686c

Browse files
committed
Update test_fastapi.py
1 parent 9e8b9ab commit 4ee686c

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

tests/test_serverless/test_modules/test_fastapi.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,13 @@ def test_start_serverless_with_realtime(self):
3030
with patch(f"{module_location}.Heartbeat.start_ping", Mock()) as mock_ping, \
3131
patch(f"{module_location}.FastAPI", Mock()) as mock_fastapi, \
3232
patch(f"{module_location}.APIRouter", return_value=Mock()) as mock_router, \
33-
patch(f"{module_location}.uvicorn", Mock()) as mock_uvicorn, \
34-
patch("runpod.serverless.os") as mock_os:
33+
patch(f"{module_location}.uvicorn", Mock()) as mock_uvicorn:
3534

3635
rp_fastapi.RUNPOD_REALTIME_PORT = '1111'
3736
rp_fastapi.RUNPOD_ENDPOINT_ID = 'test_endpoint_id'
3837

39-
# os.environ["RUNPOD_REALTIME_PORT"] = '1111'
40-
# mock return value for RUNPOD_REALTIME_PORT only
41-
mock_os.environ.get.side_effect = lambda x: '1111' if x == "RUNPOD_REALTIME_PORT" else None # pylint: disable=line-too-long
42-
43-
# os.environ["RUNPOD_ENDPOINT_ID"] = 'test_endpoint_id'
44-
mock_os.environ.get.side_effect = lambda x: 'test_endpoint_id' if x == "RUNPOD_ENDPOINT_ID" else None # pylint: disable=line-too-long
38+
os.environ["RUNPOD_REALTIME_PORT"] = '1111'
39+
os.environ["RUNPOD_ENDPOINT_ID"] = 'test_endpoint_id'
4540

4641
runpod.serverless.start({"handler": self.handler})
4742

0 commit comments

Comments
 (0)