File tree Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 2
2
set -e
3
3
# cd to self bash script directory
4
4
cd $( dirname ${BASH_SOURCE[0]} )
5
+ . ./activate.sh
5
6
echo Running isort src tests
6
7
isort src tests
7
8
echo Running black src tests
Original file line number Diff line number Diff line change 1
1
@ echo off
2
2
REM Change to the directory where the batch script is located
3
3
cd %~dp0
4
+ call venv\Scripts\activate
4
5
echo Running isort on src and tests
5
6
isort src tests
6
7
echo Running black on src and tests
Original file line number Diff line number Diff line change @@ -51,13 +51,23 @@ def test_imports(self) -> None:
51
51
self .assertTrue (os .path .exists (os .path .join (outdir , "tests" , "test_cli.py" )))
52
52
self .assertTrue (os .path .exists (os .path .join (outdir , "tox.ini" )))
53
53
os .chdir (outdir )
54
- subprocess .check_call ("pip install -e ." , shell = True )
55
- subprocess .check_call ("pip install -r requirements.testing.txt" , shell = True )
56
- subprocess .check_call ("lint" , shell = True )
57
- subprocess .check_call ("python tests/test_cli.py" , shell = True )
58
- subprocess .check_call ("pylint src tests" , shell = True )
59
- subprocess .check_call ("flake8 src tests" , shell = True )
60
- subprocess .check_call ("mypy src tests" , shell = True )
54
+
55
+ def exe (cmd : str ) -> int :
56
+ """Execute a command."""
57
+ return subprocess .call (cmd , shell = True )
58
+
59
+ cmds = [
60
+ "pip install -e ." ,
61
+ "pip install -r requirements.testing.txt" ,
62
+ "lint" ,
63
+ "python tests/test_cli.py" ,
64
+ "pylint src tests" ,
65
+ "flake8 src tests" ,
66
+ "mypy src tests" ,
67
+ ]
68
+ for cmd in cmds :
69
+ rtn = exe (cmd )
70
+ self .assertEqual (0 , rtn , f"Command failed: { cmd } " )
61
71
62
72
63
73
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments