(method)
| 721 | ], |
| 722 | ) |
| 723 | def test_head_tail(method): |
| 724 | df = DataFrame({"a": [1, 2, 3], "b": [0.1, 0.2, 0.3]}) |
| 725 | df_orig = df.copy() |
| 726 | df2 = method(df) |
| 727 | df2._mgr._verify_integrity() |
| 728 | |
| 729 | # We are explicitly deviating for CoW here to make an eager copy (avoids |
| 730 | # tracking references for very cheap ops) |
| 731 | assert not np.shares_memory(get_array(df2, "a"), get_array(df, "a")) |
| 732 | assert not np.shares_memory(get_array(df2, "b"), get_array(df, "b")) |
| 733 | |
| 734 | # modify df2 to trigger CoW for that block |
| 735 | df2.iloc[0, 0] = 0 |
| 736 | assert not np.shares_memory(get_array(df2, "b"), get_array(df, "b")) |
| 737 | assert not np.shares_memory(get_array(df2, "a"), get_array(df, "a")) |
| 738 | tm.assert_frame_equal(df, df_orig) |
| 739 | |
| 740 | |
| 741 | def test_infer_objects(using_infer_string): |
nothing calls this directly
no test coverage detected