Automatic tests

minecraft-launcher-lib uses Pytest to run some automatic tests.

Using Pytest

To get started, install pytest together with requests-mock:

pip install pytest requests-mock

To run the tests, open a command line in the root directory of minecraft-launcher-lib and execute:

pytest

If a test fails, you should fix the bug.

Test Coverage

To get the test coverage (which lines are executed during the tests) you will need pytest-cov.

Install it with pip:

pip install pytest-cov

Run pytest with coverage:

pytest -v --cov=minecraft_launcher_lib --cov-report html

A new directory called htmlcov will be created. Open the index.html from this dircetory with your browser to see the coverage report.