mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2026-04-29 07:33:26 +00:00
Merge ac752723ba into 956b8c5855
This commit is contained in:
commit
7cdfce00f9
24
test/test_niconico_downloader.py
Normal file
24
test/test_niconico_downloader.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env python
|
||||
# coding: utf-8
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
|
||||
class TestNiconicoDownloader(unittest.TestCase):
|
||||
def test_no_syntax_warning_return_in_finally(self):
|
||||
"""Issue #33243: 'return' in a 'finally' block triggers SyntaxWarning in Python 3.14+"""
|
||||
result = subprocess.run(
|
||||
[sys.executable, '-W', 'error::SyntaxWarning', '-c',
|
||||
'from youtube_dl.downloader.niconico import NiconicoDmcFD'],
|
||||
capture_output=True, text=True)
|
||||
self.assertEqual(
|
||||
result.returncode, 0,
|
||||
'Importing niconico downloader raised SyntaxWarning '
|
||||
'(return in finally block):\n' + result.stderr)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
@ -63,4 +63,4 @@ class NiconicoDmcFD(FileDownloader):
|
|||
with heartbeat_lock:
|
||||
timer[0].cancel()
|
||||
download_complete = True
|
||||
return success
|
||||
return success
|
||||
|
|
|
|||
Loading…
Reference in a new issue