This commit is contained in:
Jesse Bannon 2024-10-07 23:29:44 -07:00
parent 80a0df65c7
commit 808128659e
12 changed files with 14 additions and 30 deletions

View file

@ -2,10 +2,12 @@ from typing import Optional
import pytest import pytest
from conftest import mock_run_from_cli from conftest import mock_run_from_cli
from resources import DISABLE_YOUTUBE_TESTS
from ytdl_sub.utils.file_handler import FileMetadata from ytdl_sub.utils.file_handler import FileMetadata
@pytest.mark.skipif(DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH")
class TestView: class TestView:
@pytest.mark.parametrize("split_chapters", [True, False]) @pytest.mark.parametrize("split_chapters", [True, False])
def test_view_from_cli( def test_view_from_cli(

View file

@ -46,9 +46,8 @@ def youtube_release_preset_dict(output_directory):
}, },
} }
@pytest.mark.skipif(
DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH" @pytest.mark.skipif(DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH")
)
class TestAudioExtract: class TestAudioExtract:
@pytest.mark.parametrize("dry_run", [False]) @pytest.mark.parametrize("dry_run", [False])
def test_audio_extract_single_song( def test_audio_extract_single_song(

View file

@ -54,9 +54,7 @@ def chapters_from_comments_preset_dict(sponsorblock_and_subs_preset_dict: Dict)
return sponsorblock_and_subs_preset_dict return sponsorblock_and_subs_preset_dict
@pytest.mark.skipif( @pytest.mark.skipif(DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH")
DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH"
)
class TestChapters: class TestChapters:
@pytest.mark.parametrize("dry_run", [True, False]) @pytest.mark.parametrize("dry_run", [True, False])
def test_chapters_sponsorblock_and_removal_with_subs( def test_chapters_sponsorblock_and_removal_with_subs(

View file

@ -39,9 +39,7 @@ def rolling_recent_channel_preset_dict(recent_preset_dict):
) )
@pytest.mark.skipif( @pytest.mark.skipif(DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH")
DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH"
)
class TestDateRange: class TestDateRange:
@pytest.mark.parametrize("dry_run", [True, False]) @pytest.mark.parametrize("dry_run", [True, False])
@pytest.mark.parametrize("date_range_breaks", [True, False]) @pytest.mark.parametrize("date_range_breaks", [True, False])

View file

@ -20,9 +20,7 @@ def preset_dict(output_directory):
} }
@pytest.mark.skipif( @pytest.mark.skipif(DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH")
DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH"
)
class TestFileConvert: class TestFileConvert:
@pytest.mark.parametrize("dry_run", [True, False]) @pytest.mark.parametrize("dry_run", [True, False])
def test_file_convert( def test_file_convert(

View file

@ -46,9 +46,7 @@ def livestream_preset_dict(output_directory):
} }
@pytest.mark.skipif( @pytest.mark.skipif(DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH")
DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH"
)
class TestFileConvert: class TestFileConvert:
def test_livestreams_download_filtered( def test_livestreams_download_filtered(
self, self,

View file

@ -58,9 +58,7 @@ def yt_album_as_chapters_with_regex_preset_dict(yt_album_as_chapters_preset_dict
return yt_album_as_chapters_preset_dict return yt_album_as_chapters_preset_dict
@pytest.mark.skipif( @pytest.mark.skipif(DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH")
DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH"
)
class TestSplitByChapters: class TestSplitByChapters:
@pytest.mark.parametrize("dry_run", [True, False]) @pytest.mark.parametrize("dry_run", [True, False])
def test_video_with_chapters( def test_video_with_chapters(

View file

@ -32,9 +32,7 @@ def test_single_video_subs_embed_and_file_preset_dict(single_video_subs_embed_pr
return single_video_subs_embed_preset_dict return single_video_subs_embed_preset_dict
@pytest.mark.skipif( @pytest.mark.skipif(DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH")
DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH"
)
class TestSubtitles: class TestSubtitles:
def test_subtitle_lang_variable_partial_validates(self, default_config): def test_subtitle_lang_variable_partial_validates(self, default_config):
default_config_dict = default_config.as_dict() default_config_dict = default_config.as_dict()

View file

@ -51,9 +51,7 @@ def tv_show_collection_bilateral_dict(output_directory):
} }
@pytest.mark.skipif( @pytest.mark.skipif(DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH")
DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH"
)
class TestBilateral: class TestBilateral:
def test_tv_show_by_date_downloads_bilateral( def test_tv_show_by_date_downloads_bilateral(

View file

@ -43,9 +43,7 @@ def channel_preset_dict(output_directory):
} }
@pytest.mark.skipif( @pytest.mark.skipif(DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH")
DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH"
)
class TestChannel: class TestChannel:
""" """
Downloads my old minecraft youtube channel. Ensure the above files exist and have the Downloads my old minecraft youtube channel. Ensure the above files exist and have the

View file

@ -29,9 +29,8 @@ def single_video_preset_dict(output_directory):
}, },
} }
@pytest.mark.skipif(
DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH" @pytest.mark.skipif(DISABLE_YOUTUBE_TESTS, reason="YouTube tests cannot run in GH")
)
class TestYoutubeVideo: class TestYoutubeVideo:
@pytest.mark.parametrize("dry_run", [True, False]) @pytest.mark.parametrize("dry_run", [True, False])
def test_single_video_download( def test_single_video_download(