aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_compat.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-04-18 02:28:28 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-04-18 02:28:28 +0530
commit19a0394044bfad36cd665450271b8eb048a41c02 (patch)
tree0db2a09d23293b47f1cc3bbd3a5989120f660c37 /test/test_compat.py
parentb6dc37fe2aee167bf11f863f960a4888f4886718 (diff)
downloadhypervideo-pre-19a0394044bfad36cd665450271b8eb048a41c02.tar.lz
hypervideo-pre-19a0394044bfad36cd665450271b8eb048a41c02.tar.xz
hypervideo-pre-19a0394044bfad36cd665450271b8eb048a41c02.zip
[cleanup] Misc cleanup and refactor (#2173)
Diffstat (limited to 'test/test_compat.py')
-rw-r--r--test/test_compat.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/test_compat.py b/test/test_compat.py
index 20dab9573..29e7384f0 100644
--- a/test/test_compat.py
+++ b/test/test_compat.py
@@ -35,10 +35,12 @@ class TestCompat(unittest.TestCase):
def test_compat_expanduser(self):
old_home = os.environ.get('HOME')
- test_str = r'C:\Documents and Settings\тест\Application Data'
- compat_setenv('HOME', test_str)
- self.assertEqual(compat_expanduser('~'), test_str)
- compat_setenv('HOME', old_home or '')
+ test_str = R'C:\Documents and Settings\тест\Application Data'
+ try:
+ compat_setenv('HOME', test_str)
+ self.assertEqual(compat_expanduser('~'), test_str)
+ finally:
+ compat_setenv('HOME', old_home or '')
def test_all_present(self):
import yt_dlp.compat