wexpect-venv/tox.ini

69 lines
1.9 KiB
INI
Raw Normal View History

2020-02-22 22:55:25 +00:00
# tox.ini
# Run tests of wexpect in multiple configuration.
[tox]
# The following configuration will run automatically.
envlist = py{37}-{default,legacy_wexpect,spawn_pipe},installed,pyinstaller
[testenv]
description = Unit tests
passenv =
WEXPECT_*
# Set environment variables to select the proper configuration for each envirnment.
setenv =
spawn_pipe: WEXPECT_SPAWN_CLASS=SpawnPipe
legacy_wexpect: WEXPECT_SPAWN_CLASS=legacy_wexpect
commands =
# install the dependencies:
pip install .[test]
# Run the test itself
coverage run -m unittest
# Dump coverage summary to console
coverage report --omit=tests/*,site-packages/*
# Convert coverage report to standard xml formula the filename includes the tox environment name
# https://tox.readthedocs.io/en/latest/config.html#environment-variable-substitutions
coverage xml --omit=tests/*,site-packages -o {env:TOX_ENV_NAME}_coverage.xml
[testenv:installed]
# normal tests test the cloned files. This testenv tests the installation itself.
description = Unit tests installed
changedir = test_01_installed
# Appveyor will set the WEXPECT_SPAWN_CLASS to run the proper configuration for each run.
passenv =
WEXPECT_*
commands =
# copy all testcase into working dir
cp -r ../tests tests
# Run the test itself
python -m unittest
[testenv:pyinstaller]
# Test if wexpect working with pyinstaller. See #12 for more details.
description = Unit tests pyinstaller
# Appveyor will set the WEXPECT_SPAWN_CLASS to run the proper configuration for each run.
passenv =
WEXPECT_*
commands =
# create wexpect executable for console-reader.
pyinstaller wexpect.spec
# create test executable, to thest the console-reader
pyinstaller tests/pyinstaller_test.py
# run test:
dist\pyinstaller_test\pyinstaller_test.exe