File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 3
3
# Copyright (c) IPython Development Team.
4
4
# Distributed under the terms of the Modified BSD License.
5
5
6
+ import pygments .lexers
7
+ import pytest
6
8
from pygments import __version__ as pygments_version
7
- from pygments .token import Token
8
9
from pygments .lexers import BashLexer
10
+ from pygments .token import Token
9
11
10
12
import ipython_pygments_lexers as lexers
11
13
12
14
pyg214 = tuple (int (x ) for x in pygments_version .split ("." )[:2 ]) >= (2 , 14 )
13
15
14
16
TOKEN_WS = Token .Text .Whitespace if pyg214 else Token .Text
15
17
18
+ EXPECTED_LEXER_NAMES = [
19
+ cls .name for cls in [lexers .IPythonConsoleLexer , lexers .IPython3Lexer ]
20
+ ]
21
+
22
+
23
+ @pytest .mark .parametrize ("expected_lexer" , EXPECTED_LEXER_NAMES )
24
+ def test_pygments_entry_points (expected_lexer : str ):
25
+ """Check whether the ``entry_points`` for ``pygments.lexers`` are correct."""
26
+ all_pygments_lexer_names = {l [0 ] for l in pygments .lexers .get_all_lexers ()}
27
+ assert expected_lexer in all_pygments_lexer_names
28
+
16
29
17
30
def test_plain_python ():
18
31
lexer = lexers .IPythonLexer ()
You can’t perform that action at this time.
0 commit comments