Skip to content

Commit accc63d

Browse files
committed
fix dataset test
Signed-off-by: Grant Linville <[email protected]>
1 parent 2289075 commit accc63d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_gptscript.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -760,11 +760,11 @@ async def test_credentials(gptscript):
760760

761761
@pytest.mark.asyncio
762762
async def test_datasets(gptscript):
763-
workspace_id = await gptscript.create_workspace("directory")
763+
os.environ["GPTSCRIPT_WORKSPACE_ID"] = await gptscript.create_workspace("directory")
764764

765765
new_client = GPTScript(GlobalOptions(
766766
apiKey=os.getenv("OPENAI_API_KEY"),
767-
env=[f"GPTSCRIPT_WORKSPACE_ID={workspace_id}"],
767+
env=[f"{k}={v}" for k, v in os.environ.items()],
768768
))
769769

770770
# Create dataset
@@ -812,7 +812,7 @@ async def test_datasets(gptscript):
812812
assert datasets[0].name == "test-dataset", "Expected dataset name to match"
813813
assert datasets[0].description == "test dataset description", "Expected dataset description to match"
814814

815-
await gptscript.delete_workspace(workspace_id)
815+
await gptscript.delete_workspace(os.environ["GPTSCRIPT_WORKSPACE_ID"])
816816

817817

818818
@pytest.mark.asyncio

0 commit comments

Comments
 (0)