File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 11import shutil
2- import tempfile
32from inspect import isawaitable
43from pathlib import Path
54
@@ -35,8 +34,13 @@ async def assert_with_timeout(func, timeout=100):
3534
3635@pytest .mark .anyio
3736async def test_ydrive ():
38- with tempfile .TemporaryDirectory () as tmp_dir :
39- tmp_dir = Path (tmp_dir )
37+ tmp_dirname = "tmpdir_test_ydrive"
38+ try :
39+ tmp_dir = Path (tmp_dirname )
40+ if tmp_dir .exists ():
41+ shutil .rmtree (tmp_dirname )
42+ tmp_dir .mkdir ()
43+
4044 (tmp_dir / "file0" ).write_text (" " * 1 )
4145 (tmp_dir / "file1" ).write_text (" " * 2 )
4246 (tmp_dir / "dir0" ).mkdir ()
@@ -135,3 +139,6 @@ async def _(): return "file5" not in await ydrive.ls("dir1/dir2")
135139 await assert_with_timeout (_ )
136140 async def _ (): return "file5" in await ydrive .ls ("dir1" )
137141 await assert_with_timeout (_ )
142+
143+ finally :
144+ shutil .rmtree (tmp_dirname )
You can’t perform that action at this time.
0 commit comments