Skip to content

Commit 9313d2a

Browse files
committed
Split two tests into 3 lines each
1 parent 8ee5fba commit 9313d2a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pandas/tests/io/json/test_pandas.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -605,18 +605,19 @@ def __str__(self) -> str:
605605
df_mixed.to_json()
606606

607607
# default_handler should resolve exceptions for non-string types
608-
assert (
609-
df_nonprintable.to_json(default_handler=str) == f'{{"A":{{"0":"{hexed}"}}}}'
610-
)
608+
result = df_nonprintable.to_json(default_handler=str)
609+
expected = f'{{"A":{{"0":"{hexed}"}}}}'
610+
assert result == expected
611611
assert (
612612
df_mixed.to_json(default_handler=str)
613613
== f'{{"A":{{"0":"{hexed}"}},"B":{{"0":1}}}}'
614614
)
615615

616616
def test_label_overflow(self):
617617
# GH14256: buffer length not checked when writing label
618-
df = pd.DataFrame({"bar" * 100000: [1], "foo": [1337]})
619-
assert df.to_json() == f'{{"{"bar" * 100000}":{{"0":1}},"foo":{{"0":1337}}}}'
618+
result = pd.DataFrame({"bar" * 100000: [1], "foo": [1337]}).to_json()
619+
expected = f'{{"{"bar" * 100000}":{{"0":1}},"foo":{{"0":1337}}}}'
620+
assert result == expected
620621

621622
def test_series_non_unique_index(self):
622623
s = Series(["a", "b"], index=[1, 1])

0 commit comments

Comments
 (0)