File tree Expand file tree Collapse file tree 4 files changed +14
-15
lines changed Expand file tree Collapse file tree 4 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ Here's a simple example:
3030
3131.. code-block :: python
3232
33- from jsonschema_lexer.lexer import JSONSchemaLexer
33+ from jsonschema_lexer import JSONSchemaLexer
3434
3535 from rich.console import Console
3636 from rich.syntax import Syntax
Original file line number Diff line number Diff line change 11"""
2- Provides the JSONSchema Lexer .
2+ A JSON Schema lexer for Pygments .
33"""
4+
5+ from jsonschema_lexer ._lexer import JSONSchemaLexer
6+
7+ __all__ = ["JSONSchemaLexer" ]
File renamed without changes.
Original file line number Diff line number Diff line change 11"""
2- JSON Schema Lexer tests
2+ JSON Schema Lexer tests
33"""
44
55from pygments .token import Token
66import pytest
77
8- from jsonschema_lexer .lexer import JSONSchemaLexer
9-
10- # Test helpers.
8+ from jsonschema_lexer import JSONSchemaLexer
119
1210
1311@pytest .fixture ()
@@ -26,27 +24,24 @@ def keywords():
2624
2725
2826def assert_single_token (lexer , s , token ):
29- """Show that a given string generates only one token."""
27+ """
28+ Assert a given string generates only one token.
29+ """
3030 tokens = list (lexer .get_tokens_unprocessed (s ))
3131 assert len (tokens ) == 1
3232 assert s == tokens [0 ][2 ]
3333 assert token == tokens [0 ][1 ]
3434
3535
3636def assert_tokens (lexer , string , expected_tokens ):
37- """Show that a given string generates the expected tokens."""
37+ """
38+ Assert a given string generates the expected tokens.
39+ """
3840 tokens = list (lexer .get_tokens_unprocessed (string ))
3941 parsed_tokens = [t [1 ] for t in tokens ]
4042 assert parsed_tokens == expected_tokens
4143
4244
43- # Tests
44-
45-
46- def test_it_imports ():
47- import jsonschema_lexer # noqa: F401
48-
49-
5045def test_data_type_tokens (lexer , data_types ):
5146 for data_type in data_types :
5247 assert_single_token (lexer , data_type , Token .Name .Decorator )
You can’t perform that action at this time.
0 commit comments