Show More
@@ -0,0 +1,26 b'' | |||||
|
1 | from typing import List | |||
|
2 | ||||
|
3 | import pytest | |||
|
4 | import pygments.lexers | |||
|
5 | import pygments.lexer | |||
|
6 | ||||
|
7 | from IPython.lib.lexers import IPythonConsoleLexer, IPythonLexer, IPython3Lexer | |||
|
8 | ||||
|
9 | #: the human-readable names of the IPython lexers with ``entry_points`` | |||
|
10 | EXPECTED_LEXER_NAMES = [ | |||
|
11 | cls.name for cls in [IPythonConsoleLexer, IPythonLexer, IPython3Lexer] | |||
|
12 | ] | |||
|
13 | ||||
|
14 | ||||
|
15 | @pytest.fixture | |||
|
16 | def all_pygments_lexer_names() -> List[str]: | |||
|
17 | """Get all lexer names registered in pygments.""" | |||
|
18 | return {l[0] for l in pygments.lexers.get_all_lexers()} | |||
|
19 | ||||
|
20 | ||||
|
21 | @pytest.mark.parametrize("expected_lexer", EXPECTED_LEXER_NAMES) | |||
|
22 | def test_pygments_entry_points( | |||
|
23 | expected_lexer: str, all_pygments_lexer_names: List[str] | |||
|
24 | ) -> None: | |||
|
25 | """Check whether the ``entry_points`` for ``pygments.lexers`` are correct.""" | |||
|
26 | assert expected_lexer in all_pygments_lexer_names |
@@ -16,11 +16,11 b'' | |||||
16 | # release. 'dev' as a _version_extra string means this is a development |
|
16 | # release. 'dev' as a _version_extra string means this is a development | |
17 | # version |
|
17 | # version | |
18 | _version_major = 8 |
|
18 | _version_major = 8 | |
19 |
_version_minor = |
|
19 | _version_minor = 8 | |
20 | _version_patch = 0 |
|
20 | _version_patch = 0 | |
21 | _version_extra = ".dev" |
|
21 | _version_extra = ".dev" | |
22 | # _version_extra = "rc1" |
|
22 | # _version_extra = "rc1" | |
23 | _version_extra = "" # Uncomment this for full releases |
|
23 | # _version_extra = "" # Uncomment this for full releases | |
24 |
|
24 | |||
25 | # Construct full version string from these. |
|
25 | # Construct full version string from these. | |
26 | _ver = [_version_major, _version_minor, _version_patch] |
|
26 | _ver = [_version_major, _version_minor, _version_patch] |
@@ -146,7 +146,7 b' setup_args["entry_points"] = {' | |||||
146 | "ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer", |
|
146 | "ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer", | |
147 | "ipython = IPython.lib.lexers:IPythonLexer", |
|
147 | "ipython = IPython.lib.lexers:IPythonLexer", | |
148 | "ipython3 = IPython.lib.lexers:IPython3Lexer", |
|
148 | "ipython3 = IPython.lib.lexers:IPython3Lexer", | |
149 | ] |
|
149 | ], | |
150 | } |
|
150 | } | |
151 |
|
151 | |||
152 | #--------------------------------------------------------------------------- |
|
152 | #--------------------------------------------------------------------------- |
General Comments 0
You need to be logged in to leave comments.
Login now