-
Notifications
You must be signed in to change notification settings - Fork 23
/
tox.ini
78 lines (54 loc) · 2.05 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# tox.ini
# Run tests of wexpect in multiple configuration.
[tox]
# The following configuration will run automatically.
envlist = py{37}-{legacy_wexpect,spawn_pipe,spawn_socket},installed,pyinstaller
[testenv]
description = Unit tests
# 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
spawn_socket: WEXPECT_SPAWN_CLASS=SpawnSocket
commands =
# install the dependencies:
pip install .[test]
# Run the test itself
coverage run --parallel-mode -m unittest
# Combine the parallel results
coverage combine
# 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, with the default
# spawn class.
description = Unit tests installed, and default spawn class.
changedir = test_01_installed
whitelist_externals =
cp
commands =
# copy all testcase into working dir
cp -r ../tests tests
# Run the test itself. Running all tests is not needed, because it just test the installation,
# not functions.
python -m unittest tests.test_misc
[testenv:pyinstaller]
# Test if wexpect working with pyinstaller. See #12 for more details.
description = Unit tests pyinstaller
whitelist_externals =
pyinstaller
pyinstaller_test
setenv =
WEXPECT_SPAWN_CLASS=SpawnPipe
commands =
# install the dependencies:
pip install .[test]
# 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