Releases: basnijholt/pytest-shm
Releases · basnijholt/pytest-shm
Release list
v0.1.1
Documentation only; the plugin is unchanged from v0.1.0.
Documentation
- Add an animated logo: a memory module whose chips light up green one after another, like passing tests. It holds still under
prefers-reduced-motion. - Present the MindRoom benchmark as one data point, and show how to measure your own suite (
pytestvspytest -o shm_min_free_gib=inf). - Describe the per-session cache caveat as a general pattern, with tiktoken as a labelled example.
v0.1.0
First release.
pytest-shm moves pytest's temporary files to the /dev/shm tmpfs, so suites that fsync (SQLite commits, atomic file replacement) stop waiting on the disk. In MindRoom's suite of about 26,000 tests, summed test time on a 32-worker NVMe machine fell from 5236 s to 1426 s.
Features
- Points
TMPDIRat/dev/shmbefore anyconftest.pyis imported, on Linux, when nothing else chose a temp root and/dev/shmis writable, executable, and has at leastshm_min_free_gibGiB free (default 1). - Keeps bare
tempfileoutput from session start on inside pytest's base directory, so it cannot hold memory until reboot. - Deletes a session's base directory when it passes, collects no tests, or stops at a usage error; failing sessions keep everything for inspection.
- Works per worker under pytest-xdist: a failing run keeps only the directories of workers that saw a failure, and a caller's
--basetempis never deleted. - Stays off, and says why in the report header, when
TMPDIR/TEMP/TMPis exported,--basetemporPYTEST_DEBUG_TEMPROOTis outside/dev/shm,/dev/shmis missing, noexec, or too small, or-p no:tmpdiris passed. - Restores the caller's environment after in-process runs such as
pytest.main().
Requires Python 3.10+ and pytest 8.4+.