Skip to content

Commit 20c2988

Browse files
author
Emmanouil Konstantinidis
committed
Run tests
1 parent 822c2e3 commit 20c2988

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ python:
44
- "3.3"
55
- "3.4"
66
- "3.5"
7+
- "pypy3"
78

89
install:
910
- pip install -r requirements.txt
1011

1112
script:
12-
- scripts/runtests
13+
- python runtests.py

runtests.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env python
2+
import os
3+
import sys
4+
import subprocess
5+
6+
7+
FLAKE8_ARGS = ['drfdocs', '--ignore=E501']
8+
9+
def exit_on_failure(command, message=None):
10+
if command:
11+
sys.exit(command)
12+
13+
def flake8_main(args):
14+
print('Running: flake8', *FLAKE8_ARGS, sep=' ')
15+
command = subprocess.call(['flake8'] + args)
16+
print("" if command else "Success. flake8 passed.")
17+
return command
18+
19+
exit_on_failure(flake8_main(FLAKE8_ARGS))

0 commit comments

Comments
 (0)