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 33# Copyright (c) IPython Development Team.
44# Distributed under the terms of the Modified BSD License.
55
6+ import pygments .lexers
7+ import pytest
68from pygments import __version__ as pygments_version
7- from pygments .token import Token
89from pygments .lexers import BashLexer
10+ from pygments .token import Token
911
1012import ipython_pygments_lexers as lexers
1113
1214pyg214 = tuple (int (x ) for x in pygments_version .split ("." )[:2 ]) >= (2 , 14 )
1315
1416TOKEN_WS = Token .Text .Whitespace if pyg214 else Token .Text
1517
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+
1629
1730def test_plain_python ():
1831 lexer = lexers .IPythonLexer ()
You can’t perform that action at this time.
0 commit comments