about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authordirkf <fieldhouse@gmx.net>2023-02-06 16:19:21 +0000
committerdirkf <fieldhouse@gmx.net>2023-02-13 03:54:51 +0000
commitbafb6dec72865cc494feb35ecc94481c30a81069 (patch)
tree5f59d38e48f139b50f2003162c19af68f68019e3 /test
parent4e04f104994c5dac2cb74b64ba7725716ce939d7 (diff)
downloadyoutube-dl-bafb6dec72865cc494feb35ecc94481c30a81069.tar.gz
youtube-dl-bafb6dec72865cc494feb35ecc94481c30a81069.tar.xz
youtube-dl-bafb6dec72865cc494feb35ecc94481c30a81069.zip
[YouTube] Refresh compat/utils usage
* import parse_qs()
* import parse_qs in lazy_extractors (clears old TODO)
* clean up old compiled lazy_extractors for Py2
* use update_url()
Diffstat (limited to 'test')
-rw-r--r--test/test_execution.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/test_execution.py b/test/test_execution.py
index 32948d93e..704e14612 100644
--- a/test/test_execution.py
+++ b/test/test_execution.py
@@ -40,14 +40,16 @@ class TestExecution(unittest.TestCase):
         self.assertFalse(stderr)
 
     def test_lazy_extractors(self):
+        lazy_extractors = 'youtube_dl/extractor/lazy_extractors.py'
         try:
-            subprocess.check_call([sys.executable, 'devscripts/make_lazy_extractors.py', 'youtube_dl/extractor/lazy_extractors.py'], cwd=rootDir, stdout=_DEV_NULL)
+            subprocess.check_call([sys.executable, 'devscripts/make_lazy_extractors.py', lazy_extractors], cwd=rootDir, stdout=_DEV_NULL)
             subprocess.check_call([sys.executable, 'test/test_all_urls.py'], cwd=rootDir, stdout=_DEV_NULL)
         finally:
-            try:
-                os.remove('youtube_dl/extractor/lazy_extractors.py')
-            except (IOError, OSError):
-                pass
+            for x in ['', 'c'] if sys.version_info[0] < 3 else ['']:
+                try:
+                    os.remove(lazy_extractors + x)
+                except (IOError, OSError):
+                    pass
 
 
 if __name__ == '__main__':