Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions pandas/tests/io/json/test_ujson.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import pandas._libs.json as ujson
from pandas.compat import (
IS64,
PY310,
is_platform_windows,
)

Expand Down Expand Up @@ -253,22 +252,17 @@ def test_double_precision(self):
[
20,
-1,
pytest.param(
"9",
marks=pytest.mark.xfail(PY310, reason="Failing on Python 3.10 GH41940"),
),
pytest.param(
None,
marks=pytest.mark.xfail(PY310, reason="Failing on Python 3.10 GH41940"),
),
"9",
None,
],
)
def test_invalid_double_precision(self, invalid_val):
double_input = 30.12345678901234567890
expected_exception = ValueError if isinstance(invalid_val, int) else TypeError
msg = (
r"Invalid value '.*' for option 'double_precision', max is '15'|"
r"an integer is required \(got type "
r"an integer is required \(got type |"
r"object cannot be interpreted as an integer"
)
with pytest.raises(expected_exception, match=msg):
ujson.encode(double_input, double_precision=invalid_val)
Expand Down