Running the Test Suite

To run the test-suite, please proceed as follows.

  1. If you don’t have a git clone of PyInstaller, first fetch the current development head, either using pip, …:

    pip download --no-deps https://github.com/pyinstaller/pyinstaller/archive/develop.zip
    unzip develop.zip
    cd pyinstaller-develop/
    

    … or using git:

    git clone https://github.com/pyinstaller/pyinstaller.git
    cd pyinstaller
    
  2. Then setup a fresh virtualenv for running the test suite in and install all required tools:

    pip install --user virtualenv
    virtualenv /tmp/venv
    . /tmp/venv/bin/activate
    pip install -r tests/requirements-tools.txt
    
  3. To run a single test use e.g.:

    pytest tests/unit -k test_collect_submod_all_included
    
  4. Run the test-suite:

    pytest tests/unit tests/functional
    

    This only runs the tests for the core functionality and some packages from the Python standard library.

  5. To get better coverage, including many of the available hooks, you need to download the Python packages to be tested. For this please run:

    pip install -U -r tests/requirements-libraries.txt
    pytest tests/unit tests/functional
    

To learn how we run the test-suite in the continuous integration tests please have a look at .travis.yml (for GNU/Linux and OS X) and appveyor.yml (for Windows).