Skip to content

Commit

Permalink
flaky requests test from gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan-Adly committed Apr 15, 2024
1 parent 16be1ad commit 9560554
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions tests/test_agentrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ def test_parse_dependencies(code, expected, docker_container):
@pytest.mark.parametrize(
"code, expected, whitelist",
[
# dependencies: requests, open whitelist
# dependencies: numpy, open whitelist
(
"import requests\nprint(requests.get('https://example.com').status_code)",
"200\n",
"import numpy as np\nprint(np.array([1, 2, 3]))",
"[1 2 3]\n",
["*"],
),
# dependencies: numpy, but not in the whitelist
Expand All @@ -180,22 +180,16 @@ def test_parse_dependencies(code, expected, docker_container):
),
# dependencies: requests, in the whitelist
(
"import requests\nprint(requests.get('https://example.com').status_code)",
"200\n",
["requests"],
"import numpy as np\nprint(np.array([1, 2, 3]))",
"[1 2 3]\n",
["numpy"],
),
# a dependency that doesn't exist
(
"import unknownpackage",
"Failed to install dependency unknownpackage",
["*"],
),
# string list from env
(
"import math\nprint(math.sqrt(16))",
"4.0\n",
'["requests"]',
),
],
)
def test_execute_code_with_dependencies(code, expected, whitelist, docker_container):
Expand Down

0 comments on commit 9560554

Please sign in to comment.