Own XDG config roots before Piker or Qt imports and restore the
caller's process environment when pytest exits.
Also,
- force offscreen rendering through an explicit `--headless` flag
- restore QSettings, config globals and PyQtGraph registries per test
- prove one QApplication can serve repeated tests without state leaks
- document each teardown phase and a future public config-path API
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))