Skip to content

Commit

Permalink
Ran black
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Apr 4, 2022
1 parent 13aa30e commit 749012c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/test_ujson.py
Expand Up @@ -672,10 +672,18 @@ def test_encode_raises_allow_nan(test_input, expected_exception):

def test_nan_inf_support():
import math

text = '["a", NaN, "NaN", Infinity, "Infinity", -Infinity, "-Infinity"]'
data = ujson.loads(text)
expected = ["a", float('nan'), "NaN", float('inf'), "Infinity",
-float('inf'), "-Infinity"]
expected = [
"a",
float("nan"),
"NaN",
float("inf"),
"Infinity",
-float("inf"),
"-Infinity",
]
for a, b in zip(data, expected):
assert a == b or math.isnan(a) and math.isnan(b)

Expand Down

0 comments on commit 749012c

Please sign in to comment.