File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -605,18 +605,19 @@ def __str__(self) -> str:
605
605
df_mixed .to_json ()
606
606
607
607
# 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
611
611
assert (
612
612
df_mixed .to_json (default_handler = str )
613
613
== f'{{"A":{{"0":"{ hexed } "}},"B":{{"0":1}}}}'
614
614
)
615
615
616
616
def test_label_overflow (self ):
617
617
# 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
620
621
621
622
def test_series_non_unique_index (self ):
622
623
s = Series (["a" , "b" ], index = [1 , 1 ])
You can’t perform that action at this time.
0 commit comments