Skip to content
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

Make it possible to serialize decimal from json_arrays #75

Open
kod-kristoff opened this issue Mar 25, 2024 · 0 comments
Open

Make it possible to serialize decimal from json_arrays #75

kod-kristoff opened this issue Mar 25, 2024 · 0 comments

Comments

@kod-kristoff
Copy link
Member

@pytest.mark.parametrize(
    "json_format", [json_arrays.JsonFormat.JSON, json_arrays.JsonFormat.JSON_LINES]
)
def test_dump_decimal(
    json_format: json_arrays.JsonFormat, snapshot, array_of_dicts: list[dict]
) -> None:
    with tempfile.TemporaryFile() as fp:
        json_arrays.dump([10.20, "10.20", Decimal("10.20")], fp, json_format=json_format)
        fp.seek(0)
        data_written = fp.read()

    assert data_written == snapshot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant