]>
jfr.im git - yt-dlp.git/blob - test/test_unicode_literals.py
1 from __future__
import unicode_literals
8 rootDir
= os
.path
.dirname(os
.path
.dirname(os
.path
.abspath(__file__
)))
11 class TestUnicodeLiterals(unittest
.TestCase
):
12 def test_all_files(self
):
13 print('Skipping this test (not yet fully implemented)')
16 for dirpath
, _
, filenames
in os
.walk(rootDir
):
17 for basename
in filenames
:
18 if not basename
.endswith('.py'):
20 fn
= os
.path
.join(dirpath
, basename
)
21 with io
.open(fn
, encoding
='utf-8') as inf
:
24 if "'" not in code
and '"' not in code
:
26 imps
= 'from __future__ import unicode_literals'
29 ' %s missing in %s' % (imps
, fn
))
31 m
= re
.search(r
'(?<=\s)u[\'"](?!\)|,|$)', code)
35 'u present in %s, around %s' % (
36 fn, code[m.start() - 10:m.end() + 10]))
39 if __name__ == '__main__':