Skip to content

Commit f28a9f5

Browse files
authored
Fix JSON.ARRINDEX test (#2527)
* Fix test json.arrindex * linters * linters
1 parent 74c251a commit f28a9f5

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

tests/test_json.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,17 +1326,10 @@ def test_arrindex_dollar(client):
13261326
[],
13271327
]
13281328

1329-
# Fail with none-scalar value
1330-
with pytest.raises(exceptions.ResponseError):
1331-
client.json().arrindex("test_None", "$..nested42_empty_arr.arr", {"arr": []})
1332-
1333-
# Do not fail with none-scalar value in legacy mode
1334-
assert (
1335-
client.json().arrindex(
1336-
"test_None", ".[4][1].nested42_empty_arr.arr", '{"arr":[]}'
1337-
)
1338-
== -1
1339-
)
1329+
# Test with none-scalar value
1330+
assert client.json().arrindex(
1331+
"test_None", "$..nested42_empty_arr.arr", {"arr": []}
1332+
) == [-1]
13401333

13411334
# Test legacy (path begins with dot)
13421335
# Test index of int scalar in single value

0 commit comments

Comments
 (0)