Tests

August 12, 2026 ยท View on GitHub

Stdlib unittest for packages that live in this repo: displaydev, multimer, events, keys, boarddev, audiodev, utils, and related drivers.

_env.py puts lib/, utils/, and drivers/ on sys.path.

Running

From the repository root:

SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy python -m unittest discover -s tests -v

Do not run audiodev tests while another process is playing audio โ€” see lib/audiodev/README.md.

What is covered

ModuleArea
test_display_driver.pyDisplayDriver base class
test_fbdisplay.pyFBDisplay on a fake framebuffer
test_autodisplay.pydisplaydev.auto host selection
test_displaydev_auto.pybackends must not import displaydev.auto
test_displaydev_lifecycle.py / test_displaydev_capabilities.pyquit lifecycle and capabilities()
test_env.py / test_color.py / test_byteswap.py / test_desktop_scale.pydisplaydev helpers
test_needs_refresh.py / test_backend_isolation.pybackend flags and imports
test_jndisplay_scroll.pyJNDisplay scroll (needs IPython + Pillow)
test_pgdisplay_frame_recorder.pyframe-recorder surface
test_multimer.pypublic multimer API
test_events.py / test_keys.pyshared event types and key codes
test_boarddev.pyboarddev.bind_lazy
test_standalone.pydisplaydev and multimer import in isolation
test_mip_portable.pyportable utils/mip.py
test_audiodev*.py, test_*_audio.py, test_auto.pyaudiodev (see audio README)
test_portability.py / test_contract_proof.pyportable-module constraints