File tree 2 files changed +9
-10
lines changed
2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change 1
1
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2
2
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
3
4
- name : Python application
4
+ name : Python unit tests
5
5
6
6
on :
7
7
push :
28
28
python -m pip install --upgrade pip
29
29
pip install flake8 pytest
30
30
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31
- - name : Lint with flake8
31
+ pip install .
32
+ - name : Run tests
32
33
run : |
33
- # stop the build if there are Python syntax errors or undefined names
34
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35
- # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37
- - name : Test with pytest
38
- run : |
39
- pytest
34
+ python tests/unit_tests/run.py
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ def print_colored(text, color):
18
18
# Get a list of all .py files in that directory
19
19
py_files = glob .glob (os .path .join (current_dir , "*.py" ))
20
20
21
+ at_least_one_error = False
21
22
# Print the list of .py files
22
23
for file in py_files :
23
24
filename = os .path .basename (file )
@@ -31,4 +32,7 @@ def print_colored(text, color):
31
32
else :
32
33
print_colored ("FAILED" , RED )
33
34
print (result .stderr )
34
- break
35
+ at_least_one_error = True
36
+
37
+ if at_least_one_error :
38
+ exit (1 )
You can’t perform that action at this time.
0 commit comments