|
1 | 1 | import logging |
2 | 2 |
|
3 | | -import pytest |
4 | 3 | import lark |
5 | 4 | import lark.exceptions |
| 5 | +import pytest |
6 | 6 |
|
7 | | -from docstub._doctype import parse_doctype, Term, TermKind, BLACKLISTED_QUALNAMES |
| 7 | +from docstub._doctype import BLACKLISTED_QUALNAMES, parse_doctype |
8 | 8 |
|
9 | 9 |
|
10 | 10 | class Test_parse_doctype: |
@@ -212,14 +212,8 @@ def test_rst_role(self, doctype, expected): |
212 | 212 | ["(2, 3)", "(N, m)", "3D", "2-D", "(N, ...)", "([P,] M, N)"] |
213 | 213 | ) |
214 | 214 | def test_natlang_array(self, fmt, expected_fmt, name, dtype, shape): |
215 | | - |
216 | | - def escape(name: str) -> str: |
217 | | - return name.replace("-", "_").replace(".", "_") |
218 | | - |
219 | 215 | doctype = fmt.format(name=name, dtype=dtype, shape=shape) |
220 | | - expected = expected_fmt.format( |
221 | | - name=escape(name), dtype=escape(dtype), shape=shape |
222 | | - ) |
| 216 | + expected = expected_fmt.format(name=name, dtype=dtype, shape=shape) |
223 | 217 | expr = parse_doctype(doctype) |
224 | 218 | assert expr.as_code() == expected |
225 | 219 | # fmt: on |
@@ -267,4 +261,3 @@ def test_multiple_unknown_names(self): |
267 | 261 | PyImport(import_="Incomplete", from_="_typeshed", as_="c"), |
268 | 262 | } |
269 | 263 | assert unknown_names == [("a.b", 0, 3), ("c", 7, 8)] |
270 | | - |
0 commit comments