Skip to content

Run Pytests

Mads Ynddal edited this page Mar 16, 2024 · 2 revisions

Running Pytests

The recommended way to run the tests, is to install the dependencies from the repo:

python3 -m pip install -r requirements_tests.txt

Optional: Add test ROMs to test_roms/secrets/ otherwise some tests will be skipped. But most test ROMs will be downloaded automatically, as they are released under permissive licenses. NO COMMERCIAL ROMS ARE DISTRIBUTED OR DOWNLOADED!

Make sure to build PyBoy from source, and then you can run pytest from the root of the Git repo:

python3 -m pytest tests/ -n auto -v

Note: -n auto and -v are optional. They make the tests run with 4 CPU cores and with verbose logging.

You can also verify the doctests by running make clean and pointing pytest to the pyboy/ directory:

python3 -m pytest pyboy/ -n auto -v