Skip to content

Commit 2ba1c21

Browse files
kurtmckeemichaelmior
authored andcommitted
Refactor tests/test_exceptions.py
1 parent cda77ed commit 2ba1c21

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

tests/test_exceptions.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
11
import pytest
22

3-
from jsonpath_ng import parse as rw_parse
4-
from jsonpath_ng.exceptions import JSONPathError, JsonPathParserError
3+
from jsonpath_ng import parse as base_parse
4+
from jsonpath_ng.exceptions import JsonPathParserError
55
from jsonpath_ng.ext import parse as ext_parse
66

77

88
@pytest.mark.parametrize(
99
"path",
1010
(
11-
'foo[*.bar.baz',
12-
'foo.bar.`grandparent`.baz',
13-
# error at the end of string
14-
'foo[*',
11+
"foo[*.bar.baz",
12+
"foo.bar.`grandparent`.baz",
13+
"foo[*",
1514
# `len` extension not available in the base parser
16-
'foo.bar.`len`',
17-
)
15+
"foo.bar.`len`",
16+
),
1817
)
1918
def test_rw_exception_subclass(path):
2019
with pytest.raises(JsonPathParserError):
21-
rw_parse(path)
20+
base_parse(path)
2221

2322

2423
@pytest.mark.parametrize(
2524
"path",
2625
(
27-
'foo[*.bar.baz',
28-
'foo.bar.`grandparent`.baz',
29-
# error at the end of string
30-
'foo[*',
31-
)
26+
"foo[*.bar.baz",
27+
"foo.bar.`grandparent`.baz",
28+
"foo[*",
29+
),
3230
)
3331
def test_ext_exception_subclass(path):
3432
with pytest.raises(JsonPathParserError):

0 commit comments

Comments
 (0)