File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 7
7
8
8
CONFIG_DIR = os .path .expanduser ('~/.config/yt-fts' )
9
9
10
+
11
+ @pytest .fixture (scope = "session" , autouse = True )
12
+ def cleanup_after_tests ():
13
+ yield
14
+ if os .path .exists (CONFIG_DIR ):
15
+ shutil .rmtree (CONFIG_DIR )
16
+ if os .path .exists (f"{ CONFIG_DIR } _backup" ):
17
+ shutil .move (f"{ CONFIG_DIR } _backup" , CONFIG_DIR )
18
+
19
+
10
20
@pytest .fixture
11
21
def runner ():
12
22
return CliRunner ()
@@ -105,10 +115,8 @@ def test_playlist_download(runner, capsys):
105
115
assert video_count == 21 , f"Expected 21 videos, but got { video_count } "
106
116
assert subtitle_count >= 20970 , f"Expected 20970 subtitles, but got { subtitle_count } "
107
117
108
- shutil .rmtree (CONFIG_DIR )
109
- shutil .copytree (src = f"{ CONFIG_DIR } _backup" , dst = CONFIG_DIR )
118
+
110
119
111
120
112
121
if __name__ == "__main__" :
113
122
pytest .main ([__file__ ])
114
-
You can’t perform that action at this time.
0 commit comments