Skip to content

Commit eb457b6

Browse files
committed
update
1 parent 47cf3ed commit eb457b6

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

lint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
set -e
33
# cd to self bash script directory
44
cd $( dirname ${BASH_SOURCE[0]})
5+
. ./activate.sh
56
echo Running isort src tests
67
isort src tests
78
echo Running black src tests

lint.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@echo off
22
REM Change to the directory where the batch script is located
33
cd %~dp0
4+
call venv\Scripts\activate
45
echo Running isort on src and tests
56
isort src tests
67
echo Running black on src and tests

tests/test_createapp.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff 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

6373
if __name__ == "__main__":

0 commit comments

Comments
 (0)