Verify reading a V1 file emits one DeprecationWarning, not two.
(tempdir)
| 923 | @pytest.mark.pandas |
| 924 | @pytest.mark.filterwarnings("default:Feather V1:DeprecationWarning") |
| 925 | def test_read_feather_v1_no_double_warning(tempdir): |
| 926 | """Verify reading a V1 file emits one DeprecationWarning, not two.""" |
| 927 | table = pa.table({"a": [1, 2, 3]}) |
| 928 | path = str(tempdir / "test.feather") |
| 929 | with warnings.catch_warnings(): |
| 930 | warnings.simplefilter("ignore", DeprecationWarning) |
| 931 | write_feather(table, path, version=1) |
| 932 | with warnings.catch_warnings(record=True) as w: |
| 933 | warnings.simplefilter("always") |
| 934 | read_feather(path) |
| 935 | v1_warnings = [x for x in w if issubclass(x.category, |
| 936 | DeprecationWarning)] |
| 937 | assert len(v1_warnings) == 1 |
nothing calls this directly
no test coverage detected