Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2738778

Browse files
committed
fix coding style in test_analyzer_lexer
1 parent02e0f09 commit2738778

File tree

1 file changed

+31
-22
lines changed

1 file changed

+31
-22
lines changed

‎tests/test_analyze_lexer.py‎

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,54 +7,63 @@
77
:license: BSD, see LICENSE for details.
88
"""
99

10-
importrandom
11-
fromioimportStringIO,BytesIO
1210
fromosimportpath
1311

1412
importpytest
1513

16-
frompygmentsimportlexers,formatters,lex,format
14+
frompygmentsimportlexers
1715

1816
TESTDIR=path.dirname(path.abspath(__file__))
1917

18+
2019
def_guess_lexer_for_file(filename):
21-
returnlexers.guess_lexer(open(path.join(TESTDIR,'examplefiles',filename),'r',encoding='utf-8').read())
20+
returnlexers.guess_lexer(open(path.join(TESTDIR,'examplefiles',filename),
21+
'r',encoding='utf-8').read())
22+
2223

2324
@pytest.mark.skip(reason="This is identified as T-SQL")
2425
deftest_guess_lexer_fsharp():
25-
l=_guess_lexer_for_file('Deflate.rs')
26-
assertl.__class__.__name__=='FSharpLexer'
26+
lx=_guess_lexer_for_file('Deflate.rs')
27+
assertlx.__class__.__name__=='FSharpLexer'
28+
2729

2830
deftest_guess_lexer_brainfuck():
29-
l=lexers.guess_lexer(">>[-]<<[->>+<<]")
30-
assertl.__class__.__name__=='BrainfuckLexer'
31+
lx=lexers.guess_lexer(">>[-]<<[->>+<<]")
32+
assertlx.__class__.__name__=='BrainfuckLexer'
33+
3134

3235
deftest_guess_lexer_singularity():
33-
l=_guess_lexer_for_file('Singularity')
34-
assertl.__class__.__name__=='SingularityLexer'
36+
lx=_guess_lexer_for_file('Singularity')
37+
assertlx.__class__.__name__=='SingularityLexer'
38+
3539

3640
@pytest.mark.skip(reason="This is identified as MIME")
3741
deftest_guess_lexer_matlab():
38-
l=lexers.guess_lexer(r'A \ B')
39-
assertl.__class__.__name__=='OctaveLexer'
42+
lx=lexers.guess_lexer(r'A \ B')
43+
assertlx.__class__.__name__=='OctaveLexer'
44+
4045

4146
@pytest.mark.skip(reason="This is identified as Python")
4247
deftest_guess_lexer_hybris():
43-
l=_guess_lexer_for_file('hybris_File.hy')
44-
assertl.__class__.__name__=='HybrisLexer'
48+
lx=_guess_lexer_for_file('hybris_File.hy')
49+
assertlx.__class__.__name__=='HybrisLexer'
50+
4551

4652
deftest_guess_lexer_forth():
47-
l=_guess_lexer_for_file('demo.frt')
48-
assertl.__class__.__name__=='ForthLexer'
53+
lx=_guess_lexer_for_file('demo.frt')
54+
assertlx.__class__.__name__=='ForthLexer'
55+
4956

5057
deftest_guess_lexer_modula2():
51-
l=_guess_lexer_for_file('modula2_test_cases.def')
52-
assertl.__class__.__name__=='Modula2Lexer'
58+
lx=_guess_lexer_for_file('modula2_test_cases.def')
59+
assertlx.__class__.__name__=='Modula2Lexer'
60+
5361

5462
deftest_guess_lexer_unicon():
55-
l=_guess_lexer_for_file('example.icn')
56-
assertl.__class__.__name__=='UcodeLexer'
63+
lx=_guess_lexer_for_file('example.icn')
64+
assertlx.__class__.__name__=='UcodeLexer'
65+
5766

5867
deftest_guess_lexer_ezhil():
59-
l=_guess_lexer_for_file('ezhil_primefactors.n')
60-
assertl.__class__.__name__=='EzhilLexer'
68+
lx=_guess_lexer_for_file('ezhil_primefactors.n')
69+
assertlx.__class__.__name__=='EzhilLexer'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp