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 1
1
import shutil
2
- import tempfile
3
2
from inspect import isawaitable
4
3
from pathlib import Path
5
4
@@ -35,8 +34,13 @@ async def assert_with_timeout(func, timeout=100):
35
34
36
35
@pytest .mark .anyio
37
36
async 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
+
40
44
(tmp_dir / "file0" ).write_text (" " * 1 )
41
45
(tmp_dir / "file1" ).write_text (" " * 2 )
42
46
(tmp_dir / "dir0" ).mkdir ()
@@ -135,3 +139,6 @@ async def _(): return "file5" not in await ydrive.ls("dir1/dir2")
135
139
await assert_with_timeout (_ )
136
140
async def _ (): return "file5" in await ydrive .ls ("dir1" )
137
141
await assert_with_timeout (_ )
142
+
143
+ finally :
144
+ shutil .rmtree (tmp_dirname )
You can’t perform that action at this time.
0 commit comments