| 279 | |
| 280 | @pytest.mark.parametrize('pool_factory', supported_factories()) |
| 281 | def test_print_stats(pool_factory): |
| 282 | code = f"""if 1: |
| 283 | import pyarrow as pa |
| 284 | |
| 285 | pool = pa.{pool_factory.__name__}() |
| 286 | buf = pa.allocate_buffer(64, memory_pool=pool) |
| 287 | pool.print_stats() |
| 288 | """ |
| 289 | res = subprocess.run([sys.executable, "-c", code], check=True, |
| 290 | universal_newlines=True, stdout=subprocess.PIPE, |
| 291 | stderr=subprocess.PIPE) |
| 292 | if sys.platform == "linux" and not util.running_on_musllinux(): |
| 293 | # On Linux with glibc at least, all memory pools should emit statistics |
| 294 | assert res.stderr.strip() != "" |