diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-05 16:20:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-05 16:20:58 +0000 |
commit | 5bb0bb4be543fd5eca41673696a62ed80d493591 (patch) | |
tree | ad2c464f140e86c7f178a6276d7ea4a93e3e6c92 /tests/test_pycode | |
parent | Adding upstream version 7.2.6. (diff) | |
download | sphinx-upstream.tar.xz sphinx-upstream.zip |
Adding upstream version 7.3.7.upstream/7.3.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/test_pycode/__init__.py | 0 | ||||
-rw-r--r-- | tests/test_pycode/test_pycode.py (renamed from tests/test_pycode.py) | 0 | ||||
-rw-r--r-- | tests/test_pycode/test_pycode_ast.py (renamed from tests/test_pycode_ast.py) | 10 | ||||
-rw-r--r-- | tests/test_pycode/test_pycode_parser.py (renamed from tests/test_pycode_parser.py) | 0 |
4 files changed, 8 insertions, 2 deletions
diff --git a/tests/test_pycode/__init__.py b/tests/test_pycode/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/test_pycode/__init__.py diff --git a/tests/test_pycode.py b/tests/test_pycode/test_pycode.py index 5739787..5739787 100644 --- a/tests/test_pycode.py +++ b/tests/test_pycode/test_pycode.py diff --git a/tests/test_pycode_ast.py b/tests/test_pycode/test_pycode_ast.py index 5efd0cb..1ed43e1 100644 --- a/tests/test_pycode_ast.py +++ b/tests/test_pycode/test_pycode_ast.py @@ -18,7 +18,7 @@ from sphinx.pycode.ast import unparse as ast_unparse ("a and b and c", "a and b and c"), # BoolOp ("b'bytes'", "b'bytes'"), # Bytes ("object()", "object()"), # Call - ("1234", "1234"), # Constant + ("1234", "1234"), # Constant, Num ("{'key1': 'value1', 'key2': 'value2'}", "{'key1': 'value1', 'key2': 'value2'}"), # Dict ("a / b", "a / b"), # Div @@ -34,7 +34,6 @@ from sphinx.pycode.ast import unparse as ast_unparse ("a % b", "a % b"), # Mod ("a * b", "a * b"), # Mult ("sys", "sys"), # Name, NameConstant - ("1234", "1234"), # Num ("not a", "not a"), # Not ("a or b", "a or b"), # Or ("a**b", "a**b"), # Pow @@ -52,6 +51,13 @@ from sphinx.pycode.ast import unparse as ast_unparse "lambda x=0, /, y=1, *args, z, **kwargs: ..."), # posonlyargs ("0x1234", "0x1234"), # Constant ("1_000_000", "1_000_000"), # Constant + ("Tuple[:,:]", "Tuple[:, :]"), # Index, Subscript, 2x Slice + ("Tuple[1:2]", "Tuple[1:2]"), # Index, Subscript, Slice(no-step) + ("Tuple[1:2:3]", "Tuple[1:2:3]"), # Index, Subscript, Slice + ("x[:, np.newaxis, :, :]", + "x[:, np.newaxis, :, :]"), # Index, Subscript, numpy extended syntax + ("y[:, 1:3][np.array([0, 2, 4]), :]", + "y[:, 1:3][np.array([0, 2, 4]), :]"), # Index, 2x Subscript, numpy extended syntax ]) def test_unparse(source, expected): module = ast.parse(source) diff --git a/tests/test_pycode_parser.py b/tests/test_pycode/test_pycode_parser.py index fde648d..fde648d 100644 --- a/tests/test_pycode_parser.py +++ b/tests/test_pycode/test_pycode_parser.py |