Skip to content

TST: Update error msg for Python 3.10 #45567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 23, 2022
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