Skip to content

Commit 5b56e22

Browse files
committed
chore: make workspace ID required when deleting a workspace
Signed-off-by: Donnie Adams <[email protected]>
1 parent b9b481e commit 5b56e22

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

gptscript/gptscript.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,9 @@ async def create_workspace(self, provider_type: str, from_workspaces: list[str]
318318
}
319319
)
320320

321-
async def delete_workspace(self, workspace_id: str = ""):
321+
async def delete_workspace(self, workspace_id: str):
322322
if workspace_id == "":
323-
workspace_id = os.environ["GPTSCRIPT_WORKSPACE_ID"]
323+
raise ValueError("workspace_id cannot be empty")
324324

325325
await self._run_basic_command(
326326
"workspaces/delete",

tests/test_gptscript.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ def gptscript():
4040

4141

4242
# Simple tool for testing
43-
@pytest.fixture
43+
@pytest.fixture(scope="function")
4444
def simple_tool():
4545
return ToolDef(
4646
instructions="What is the capital of the united states?"
4747
)
4848

4949

5050
# Complex tool for testing
51-
@pytest.fixture
51+
@pytest.fixture(scope="function")
5252
def complex_tool():
5353
return ToolDef(
5454
jsonResponse=True,
@@ -68,7 +68,7 @@ def complex_tool():
6868

6969

7070
# Fixture for a list of tools
71-
@pytest.fixture
71+
@pytest.fixture(scope="function")
7272
def tool_list():
7373
shebang = "#!/bin/bash"
7474
if platform.system().lower() == "windows":

0 commit comments

Comments
 (0)