web2py.py --run_system_tests, thanks Marc Abramowitz
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 1.99.7 (2012-05-10 18:02:10) dev
|
Version 1.99.7 (2012-05-10 18:20:22) dev
|
||||||
|
|||||||
@@ -80,6 +80,7 @@
|
|||||||
</li><li>Kyle Smith (javascript)
|
</li><li>Kyle Smith (javascript)
|
||||||
</li><li><a href="http://blog.donews.com/limodou/">Limodou</a> (winservice)
|
</li><li><a href="http://blog.donews.com/limodou/">Limodou</a> (winservice)
|
||||||
</li><li><a href="https://github.com/lucasdavila">Lucas D'Ávila</a>
|
</li><li><a href="https://github.com/lucasdavila">Lucas D'Ávila</a>
|
||||||
|
</li><li>Marc Abramowitz (tests and travis continuous integration)
|
||||||
</li><li><a href="http://www.mlsystems.ch">Marcel Leuthi</a> (Oracle support)
|
</li><li><a href="http://www.mlsystems.ch">Marcel Leuthi</a> (Oracle support)
|
||||||
</li><li>Marcel Hellkamp (Bottle developer, multiple web server support)
|
</li><li>Marcel Hellkamp (Bottle developer, multiple web server support)
|
||||||
</li><li>Marcello Della Longa (italian translation)
|
</li><li>Marcello Della Longa (italian translation)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from pymysql.tests.test_issues import *
|
from gluon.contrib.pymysql.tests.test_issues import *
|
||||||
from pymysql.tests.test_example import *
|
from gluon.contrib.pymysql.tests.test_example import *
|
||||||
from pymysql.tests.test_basic import *
|
from gluon.contrib.pymysql.tests.test_basic import *
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import unittest
|
import unittest
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import pymysql
|
from gluon.contrib import pymysql
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
class PyMySQLTestCase(unittest.TestCase):
|
class PyMySQLTestCase(unittest.TestCase):
|
||||||
@@ -8,10 +8,13 @@ class PyMySQLTestCase(unittest.TestCase):
|
|||||||
{"host":"localhost","user":"root","passwd":"","db":"test_pymysql2"}]
|
{"host":"localhost","user":"root","passwd":"","db":"test_pymysql2"}]
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.connections = []
|
try:
|
||||||
|
self.connections = []
|
||||||
|
|
||||||
for params in self.databases:
|
for params in self.databases:
|
||||||
self.connections.append(pymysql.connect(**params))
|
self.connections.append(pymysql.connect(**params))
|
||||||
|
except pymysql.err.OperationalError as e:
|
||||||
|
self.skipTest('Cannot connect to MySQL - skipping pymysql tests because of (%s) %s' % (type(e), e))
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
for connection in self.connections:
|
for connection in self.connections:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from pymysql.tests import base
|
from gluon.contrib.pymysql.tests import base
|
||||||
from pymysql import util
|
from gluon.contrib.pymysql import util
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import pymysql
|
from gluon.contrib import pymysql
|
||||||
from pymysql.tests import base
|
from gluon.contrib.pymysql.tests import base
|
||||||
|
|
||||||
class TestExample(base.PyMySQLTestCase):
|
class TestExample(base.PyMySQLTestCase):
|
||||||
def test_example(self):
|
def test_example(self):
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import pymysql
|
from gluon.contrib import pymysql
|
||||||
from pymysql.tests import base
|
from gluon.contrib.pymysql.tests import base
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,23 @@ if not sys.version[:3] in ['2.4', '2.5', '2.6', '2.7']:
|
|||||||
|
|
||||||
logger = logging.getLogger("web2py")
|
logger = logging.getLogger("web2py")
|
||||||
|
|
||||||
|
def run_system_tests():
|
||||||
|
major_version = sys.version_info[0]
|
||||||
|
minor_version = sys.version_info[1]
|
||||||
|
print "minor_version = %r" % minor_version
|
||||||
|
if major_version == 2:
|
||||||
|
if minor_version in (5, 6):
|
||||||
|
print "Python 2.5 or 2.6"
|
||||||
|
os.system("PYTHONPATH=. unit2 -v gluon.tests")
|
||||||
|
elif minor_version in (7,):
|
||||||
|
print "Python 2.7"
|
||||||
|
os.system("PYTHONPATH=. python -m unittest -v gluon.tests")
|
||||||
|
else:
|
||||||
|
print "unknown python 2.x version"
|
||||||
|
else:
|
||||||
|
print "Only Python 2.x supported."
|
||||||
|
|
||||||
|
|
||||||
class IO(object):
|
class IO(object):
|
||||||
""" """
|
""" """
|
||||||
|
|
||||||
@@ -735,6 +752,14 @@ def console():
|
|||||||
default=None,
|
default=None,
|
||||||
help=msg)
|
help=msg)
|
||||||
|
|
||||||
|
|
||||||
|
msg = 'runs web2py tests'
|
||||||
|
parser.add_option('--run_system_tests',
|
||||||
|
action='store_true',
|
||||||
|
dest='run_system_tests',
|
||||||
|
default=False,
|
||||||
|
help=msg)
|
||||||
|
|
||||||
if '-A' in sys.argv: k = sys.argv.index('-A')
|
if '-A' in sys.argv: k = sys.argv.index('-A')
|
||||||
elif '--args' in sys.argv: k = sys.argv.index('--args')
|
elif '--args' in sys.argv: k = sys.argv.index('--args')
|
||||||
else: k=len(sys.argv)
|
else: k=len(sys.argv)
|
||||||
@@ -744,6 +769,10 @@ def console():
|
|||||||
global_settings.cmd_options = options
|
global_settings.cmd_options = options
|
||||||
global_settings.cmd_args = args
|
global_settings.cmd_args = args
|
||||||
|
|
||||||
|
if options.run_system_tests:
|
||||||
|
run_system_tests()
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
if options.quiet:
|
if options.quiet:
|
||||||
capture = cStringIO.StringIO()
|
capture = cStringIO.StringIO()
|
||||||
sys.stdout = capture
|
sys.stdout = capture
|
||||||
|
|||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
language: python
|
||||||
|
|
||||||
|
python:
|
||||||
|
- '2.5'
|
||||||
|
- '2.6'
|
||||||
|
- '2.7'
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- pip install unittest2
|
||||||
|
- mysql -e 'create database test_pymysql;'
|
||||||
|
- mysql -e 'create database test_pymysql2;'
|
||||||
|
|
||||||
|
script: PYTHONPATH=. unit2 -v gluon.tests
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
irc:
|
||||||
|
channels: "irc.freenode.org#web2py"
|
||||||
Reference in New Issue
Block a user