forked from pycontribs/tendo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test
executable file
·32 lines (25 loc) · 1.13 KB
/
test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
"""
The main purpose of this file is to run tox only with the current existing python interpretors.
"""
import os
import sys
import logging
if __name__ == "__main__":
log = logging.getLogger()
# now we'll detect which python interpretors we have on this machine and run the tests for all of them
known_pys = { 'python2.5':'py25', 'python2.6':'py26', 'python2.7':'py27' } # ,'python3':'py3', 'python3.2':'py32', 'python4':'py4'}
#known_pys = { 'python2.7':'py27' } # ,'python3':'py3', 'python3.2':'py32', 'python4':'py4'}
detected_pys = set()
for known_py in known_pys:
if os.system("which %s >/dev/null" % known_py) == 0:
detected_pys.add(known_pys[known_py])
detected_pys.add('docs')
#os.system("python setup.py test")
cmds = ["autopep8 --ignore=E501 -i *.py tendo/*.py demo/*.py",
"pep8",
"tox -e %s" % ",".join(detected_pys)]
for cmd in cmds:
if os.system(cmd) != 0:
print("ERROR: Command `%s` failed, testing stopped here." % cmd)
sys.exit(6)