Skip to content

Commit 31d0dbe

Browse files
committed
fix: use tmp_path fixture in test_download to avoid cwd pollution
1 parent 02cbd44 commit 31d0dbe

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

test/test_workbook.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,15 +318,14 @@ def test_update_tags(server: TSC.Server) -> None:
318318
assert single_workbook._initial_tags == updated_workbook._initial_tags
319319

320320

321-
def test_download(server: TSC.Server) -> None:
321+
def test_download(server: TSC.Server, tmp_path: Path) -> None:
322322
with requests_mock.mock() as m:
323323
m.get(
324324
server.workbooks.baseurl + "/1f951daf-4061-451a-9df1-69a8062664f2/content",
325325
headers={"Content-Disposition": 'name="tableau_workbook"; filename="RESTAPISample.twbx"'},
326326
)
327-
file_path = server.workbooks.download("1f951daf-4061-451a-9df1-69a8062664f2")
327+
file_path = server.workbooks.download("1f951daf-4061-451a-9df1-69a8062664f2", filepath=tmp_path)
328328
assert os.path.exists(file_path)
329-
os.remove(file_path)
330329

331330

332331
def test_download_object(server: TSC.Server) -> None:

0 commit comments

Comments
 (0)