From 1703935375bf85169916e1a88bf0b32b172e58c7 Mon Sep 17 00:00:00 2001 From: unknown <7951720+u-n-k-n-o-w-n@users.noreply.github.com> Date: Sun, 21 Aug 2022 23:25:54 +0900 Subject: [PATCH] webdriver tests only when specified --- test/test_youtube_signature.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/test/test_youtube_signature.py b/test/test_youtube_signature.py index f9e520a0b..9068551ba 100644 --- a/test/test_youtube_signature.py +++ b/test/test_youtube_signature.py @@ -258,11 +258,17 @@ make_nsig_test = t_factory( for test_spec in _NSIG_TESTS: make_nsig_test(*test_spec) -make_nsig_wd_test = t_factory( - 'nsig_wd', n_sig_wd, re.compile(r'.+/player/(?P[a-zA-Z0-9_-]+)/.+.js$')) -for test_spec in _NSIG_TESTS: - make_nsig_wd_test(*test_spec) - +test_wd = False +for arg in sys.argv: + if arg == '--test_wd': + test_wd = True + break +if test_wd: + sys.argv = [arg for arg in sys.argv if arg != '--test_wd'] + make_nsig_wd_test = t_factory( + 'nsig_wd', n_sig_wd, re.compile(r'.+/player/(?P[a-zA-Z0-9_-]+)/.+.js$')) + for test_spec in _NSIG_TESTS: + make_nsig_wd_test(*test_spec) if __name__ == '__main__': unittest.main()