Skip to content

Commit e11b6fb

Browse files
authored
Merge pull request #40 from vuLgAr/making-tests-fail
Making tests fail
2 parents 1f23c3c + c708a26 commit e11b6fb

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

{{cookiecutter.app_slug}}/manage.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from project.server import create_app, db
1111
from project.server.models import User
1212
import subprocess
13+
import sys
1314

1415
app = create_app()
1516
cli = FlaskGroup(create_app=create_app)
@@ -59,8 +60,9 @@ def test():
5960
tests = unittest.TestLoader().discover('project/tests', pattern='test*.py')
6061
result = unittest.TextTestRunner(verbosity=2).run(tests)
6162
if result.wasSuccessful():
62-
return 0
63-
return 1
63+
sys.exit(0)
64+
else:
65+
sys.exit(1)
6466

6567

6668
@cli.command()
@@ -75,8 +77,9 @@ def cov():
7577
COV.report()
7678
COV.html_report()
7779
COV.erase()
78-
return 0
79-
return 1
80+
sys.exit(0)
81+
else:
82+
sys.exit(1)
8083

8184

8285
@cli.command()

0 commit comments

Comments
 (0)