()
| 204 | |
| 205 | |
| 206 | def test_info_memory(): |
| 207 | # https://github.com/pandas-dev/pandas/issues/21056 |
| 208 | df = DataFrame({"a": Series([1, 2], dtype="i8")}) |
| 209 | buf = StringIO() |
| 210 | df.info(buf=buf) |
| 211 | result = buf.getvalue() |
| 212 | bytes = float(df.memory_usage().sum()) |
| 213 | expected = textwrap.dedent( |
| 214 | f"""\ |
| 215 | <class 'pandas.DataFrame'> |
| 216 | RangeIndex: 2 entries, 0 to 1 |
| 217 | Data columns (total 1 columns): |
| 218 | # Column Non-Null Count Dtype |
| 219 | --- ------ -------------- ----- |
| 220 | 0 a 2 non-null int64 |
| 221 | dtypes: int64(1) |
| 222 | memory usage: {bytes} bytes |
| 223 | """ |
| 224 | ) |
| 225 | assert result == expected |
| 226 | |
| 227 | |
| 228 | def test_info_wide(): |
nothing calls this directly
no test coverage detected