From 854de00eb520a74edd6d9e31632a970993bfecc9 Mon Sep 17 00:00:00 2001 From: Joe Martinez Date: Thu, 4 Jul 2024 21:58:46 -0500 Subject: [PATCH] mutted warnings --- pytest.ini | 4 ++++ tests/test_download.py | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 pytest.ini diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..d9c1880 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,4 @@ +[pytest] +filterwarnings = + ignore::DeprecationWarning + ignore::PendingDeprecationWarning \ No newline at end of file diff --git a/tests/test_download.py b/tests/test_download.py index 11dcc6b..9012df8 100644 --- a/tests/test_download.py +++ b/tests/test_download.py @@ -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() @@ -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__":