diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-04-18 02:28:28 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-04-18 02:28:28 +0530 |
commit | 19a0394044bfad36cd665450271b8eb048a41c02 (patch) | |
tree | 0db2a09d23293b47f1cc3bbd3a5989120f660c37 /test/test_youtube_signature.py | |
parent | b6dc37fe2aee167bf11f863f960a4888f4886718 (diff) | |
download | hypervideo-pre-19a0394044bfad36cd665450271b8eb048a41c02.tar.lz hypervideo-pre-19a0394044bfad36cd665450271b8eb048a41c02.tar.xz hypervideo-pre-19a0394044bfad36cd665450271b8eb048a41c02.zip |
[cleanup] Misc cleanup and refactor (#2173)
Diffstat (limited to 'test/test_youtube_signature.py')
-rw-r--r-- | test/test_youtube_signature.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/test_youtube_signature.py b/test/test_youtube_signature.py index ca23c910d..2c2013295 100644 --- a/test/test_youtube_signature.py +++ b/test/test_youtube_signature.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 # Allow direct execution +import contextlib import os import sys import unittest @@ -127,11 +128,9 @@ class TestSignature(unittest.TestCase): os.mkdir(self.TESTDATA_DIR) def tearDown(self): - try: + with contextlib.suppress(OSError): for f in os.listdir(self.TESTDATA_DIR): os.remove(f) - except OSError: - pass def t_factory(name, sig_func, url_pattern): |