mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-07-27 16:10:52 -07:00
Core: Allow running unit tests scoped to specific worlds (#6290)
This allows the unit tests to be run on specific worlds only, it works by using an environment variable AP_TEST_WORLDS which is a comma separated list of world directories.
This commit is contained in:
@@ -137,10 +137,26 @@ tests folder within your world.
|
||||
You can also find the 'Archipelago Unittests' as an option in the dropdown at the top of the window
|
||||
next to the run and debug buttons.
|
||||
|
||||
To run the suite scoped to a single world, use the shared **APQuest Tests** run configuration in the dropdown.
|
||||
To test your own world, duplicate it in *Edit Configurations…* and change the `AP_TEST_WORLDS` environment
|
||||
variable to your world's folder name.
|
||||
|
||||
#### Running Tests without Pycharm
|
||||
|
||||
Run `pip install pytest pytest-subtests`, then use your IDE to run tests or run `pytest` from the source folder.
|
||||
|
||||
#### Running Tests for Specific Worlds
|
||||
|
||||
Set the `AP_TEST_WORLDS` environment variable to a comma-separated list of world **folder** names to scope a run
|
||||
to just those worlds:
|
||||
|
||||
```
|
||||
AP_TEST_WORLDS=apquest pytest
|
||||
```
|
||||
|
||||
Pass several worlds with a comma, e.g. `AP_TEST_WORLDS=apquest,pokemon_emerald`. Add
|
||||
`--continue-on-collection-errors` if your environment is missing the webhost requirements (`flask`, etc.).
|
||||
|
||||
#### Running Tests Multithreaded
|
||||
|
||||
pytest can run multiple test runners in parallel with the pytest-xdist extension.
|
||||
|
||||
Reference in New Issue
Block a user