Skip to content

Commit

Permalink
mutted warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
NotJoeMartinez committed Jul 5, 2024
1 parent 24dc504 commit 854de00
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pytest]
filterwarnings =
ignore::DeprecationWarning
ignore::PendingDeprecationWarning
12 changes: 8 additions & 4 deletions tests/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ def reset_testing_env():
print('running tests with existing db')


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

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

print(res)
assert res[0] > 0, f"Expected at least one video, but got {res[0]}"
# captured = capsys.readouterr()
# print(f"Captured output: {captured.out}")

video_count = res[0]

assert video_count == 17, f"Expected 17 videos, but got {video_count}"


if __name__ == "__main__":
Expand Down

0 comments on commit 854de00

Please sign in to comment.