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 22set -e
33# cd to self bash script directory
44cd $( dirname ${BASH_SOURCE[0]} )
5+ . ./activate.sh
56echo Running isort src tests
67isort src tests
78echo Running black src tests
Original file line number Diff line number Diff line change 11@ echo off
22REM Change to the directory where the batch script is located
33cd %~dp0
4+ call venv\Scripts\activate
45echo Running isort on src and tests
56isort src tests
67echo 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:
5151 self .assertTrue (os .path .exists (os .path .join (outdir , "tests" , "test_cli.py" )))
5252 self .assertTrue (os .path .exists (os .path .join (outdir , "tox.ini" )))
5353 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 } " )
6171
6272
6373if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments