Skip to content

Commit

Permalink
Test empty json
Browse files Browse the repository at this point in the history
  • Loading branch information
nineteendo committed Jul 17, 2024
1 parent 013d93c commit 25f23a0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/jsonyx/test_jsonyx/test_loads.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
from types import ModuleType


def test_empty(json: ModuleType) -> None:
"""Test empty JSON."""
with pytest.raises(json.JSONSyntaxError) as exc_info:
json.loads("")

exc: Any = exc_info.value
assert exc.msg == "Expecting value"
assert exc.lineno == 1
assert exc.colno == 1


@pytest.mark.parametrize(("string", "expected"), [
("true", True),
("false", False),
Expand Down

0 comments on commit 25f23a0

Please sign in to comment.