Skip to content

Commit 19c0a87

Browse files
committed
Travis CI: Run each failing pytest in allow_failures mode
1 parent 15c69c8 commit 19c0a87

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

.travis.yml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,35 @@ python: 3.7
44
cache: pip
55
before_install: pip install --upgrade pip setuptools
66
install: pip install -r requirements.txt
7+
matrix:
8+
include:
9+
- name: "Main tests"
10+
# The following files currently fail pytests. See issues: #1016, #1044, #1080
11+
# Here they are run allow_failures mode and when each passes pytest, it can be
12+
# removed BOTH lists below. Complex now but simple once all files pass pytest.
13+
- before_script: FILE=data_structures/stacks/balanced_parentheses.py
14+
script: pytest ${FILE} --doctest-modules
15+
- before_script: FILE=data_structures/stacks/infix_to_postfix_conversion.py
16+
script: pytest ${FILE} --doctest-modules
17+
# - before_script: FILE=file_transfer_protocol/ftp_client_server.py
18+
# script: pytest ${FILE} --doctest-modules
19+
- before_script: FILE=file_transfer_protocol/ftp_send_receive.py
20+
script: pytest ${FILE} --doctest-modules
21+
- before_script: FILE=machine_learning/linear_regression.py
22+
script: pytest ${FILE} --doctest-modules
23+
- before_script: FILE=machine_learning/perceptron.py
24+
script: pytest ${FILE} --doctest-modules
25+
- before_script: FILE=machine_learning/random_forest_classification/random_forest_classification.py
26+
script: pytest ${FILE} --doctest-modules
27+
- before_script: FILE=machine_learning/random_forest_regression/random_forest_regression.py
28+
script: pytest ${FILE} --doctest-modules
29+
allow_failures:
30+
- script: pytest ${FILE} --doctest-modules
731
before_script:
832
- black --check . || true
933
- flake8 . --count --select=E9,F401,F63,F7,F82 --show-source --statistics
1034
script:
11-
- scripts/validate_filenames.py # no uppercase and no spaces
35+
- scripts/validate_filenames.py # no uppercase, no spaces, in a directory
1236
- mypy --ignore-missing-imports .
1337
- pytest . --doctest-modules
1438
--ignore=data_structures/stacks/balanced_parentheses.py
@@ -19,16 +43,6 @@ script:
1943
--ignore=machine_learning/perceptron.py
2044
--ignore=machine_learning/random_forest_classification/random_forest_classification.py
2145
--ignore=machine_learning/random_forest_regression/random_forest_regression.py
22-
# The following files currently fail pytests. See issues: #1016, #1044, #1080
23-
# Here they are run || true and when each passes pytest, it can be removed above and below.
24-
- pytest data_structures/stacks/balanced_parentheses.py --doctest-modules ; || true
25-
- pytest data_structures/stacks/infix_to_postfix_conversion.py --doctest-modules ; || true
26-
- pytest file_transfer_protocol/ftp_send_receive.py --doctest-modules ; || true
27-
# ftp_client_server.py currently hangs until Travis CI times out (10+ minutes)
28-
# - pytest file_transfer_protocol/ftp_client_server.py --doctest-modules ; || true
29-
- pytest machine_learning/linear_regression.py --doctest-modules ; || true
30-
- pytest machine_learning/random_forest_classification/random_forest_classification.py --doctest-modules ; || true
31-
- pytest machine_learning/random_forest_regression/random_forest_regression.py --doctest-modules ; || true
3246

3347
after_success:
3448
- scripts/build_directory_md.py > DIRECTORY.md

0 commit comments

Comments
 (0)