Skip to content

Commit 854de00

Browse files
mutted warnings
1 parent 24dc504 commit 854de00

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

pytest.ini

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[pytest]
2+
filterwarnings =
3+
ignore::DeprecationWarning
4+
ignore::PendingDeprecationWarning

tests/test_download.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ def reset_testing_env():
2121
print('running tests with existing db')
2222

2323

24-
def test_successful_download(runner):
24+
def test_successful_download(runner, capsys): # Add capsys as a parameter
2525
reset_testing_env()
26-
runner.invoke(cli, ['download', 'https://www.youtube.com/@JCS'])
26+
runner.invoke(cli, ['download', '-j', '5', 'https://www.youtube.com/@JCS'])
2727
conn = sqlite3.connect(f"{CONFIG_DIR}/subtitles.db")
2828
curr = conn.cursor()
2929

@@ -34,8 +34,12 @@ def test_successful_download(runner):
3434
res = curr.execute(query)
3535
res = res.fetchone()
3636

37-
print(res)
38-
assert res[0] > 0, f"Expected at least one video, but got {res[0]}"
37+
# captured = capsys.readouterr()
38+
# print(f"Captured output: {captured.out}")
39+
40+
video_count = res[0]
41+
42+
assert video_count == 17, f"Expected 17 videos, but got {video_count}"
3943

4044

4145
if __name__ == "__main__":

0 commit comments

Comments
 (0)