File tree Expand file tree Collapse file tree 3 files changed +33
-3
lines changed
Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 44- ' 3.6'
55env :
66 matrix :
7+ - TEST_FILENAME=''
78 - TEST_FILENAME=test_add_target.py::TestActiveFlag
89 - TEST_FILENAME=test_add_target.py::TestApplicationMetadata
910 - TEST_FILENAME=test_add_target.py::TestContentTypes
@@ -48,9 +49,8 @@ install:
4849- travis_retry npm install -g markdownlint-cli
4950cache : pip
5051before_script :
51- - make lint
5252- python ci/set_secrets_file.py
5353script :
54- - pytest --exitfirst -vvv tests/mock_vws/"$TEST_FILENAME" --cov=src --cov=tests
54+ - python ci/run_script.py
5555after_success :
5656- codecov
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ pip install --editable .[dev]
1414
1515Insall ` npm ` dependencies for linting Markdown files:
1616
17- ```
17+ ``` sh
1818npm install -g markdownlint-cli
1919```
2020
Original file line number Diff line number Diff line change 1+ """
2+ Run tests and linters on Travis CI.
3+ """
4+
5+ import os
6+ import subprocess
7+ from pathlib import Path
8+
9+ import pytest
10+
11+
12+ def run_test (test_filename : str ) -> None :
13+ """
14+ Run pytest with a given filename.
15+ """
16+ path = Path ('tests' ) / 'mock_vws' / test_filename
17+ pytest .main ([
18+ '--exitfirst' ,
19+ str (path ),
20+ '--cov=src' ,
21+ '--cov=tests' ,
22+ ])
23+
24+
25+ if __name__ == '__main__' :
26+ TEST_FILENAME = os .environ .get ('TEST_FILENAME' )
27+ if TEST_FILENAME :
28+ run_test (test_filename = TEST_FILENAME )
29+ else :
30+ subprocess .check_call (['make' , 'lint' ])
You can’t perform that action at this time.
0 commit comments