added tests for py36

This commit is contained in:
ilvalle
2017-03-06 18:28:37 +01:00
parent 16f60d5cff
commit ad421e42c6
3 changed files with 4 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ python:
- '2.7'
- 'pypy'
- '3.5'
- '3.6'
install:
- pip install -e .

View File

@@ -317,7 +317,7 @@ def load(routes='routes.py', app=None, data=None, rdict=None):
symbols = dict(app=app)
try:
exec(data + '\n', symbols)
exec(data, symbols)
except SyntaxError as e:
logger.error(
'%s has a syntax error and will not be loaded\n' % path

View File

@@ -95,14 +95,14 @@ class TestRouter(unittest.TestCase):
""" Test router syntax error """
level = logger.getEffectiveLevel()
logger.setLevel(logging.CRITICAL) # disable logging temporarily
self.assertRaises(SyntaxError, load, data='x:y')
self.assertRaises(SyntaxError, load, data='x::y')
self.assertRaises(
SyntaxError, load, rdict=dict(BASE=dict(badkey="value")))
self.assertRaises(SyntaxError, load, rdict=dict(
BASE=dict(), app=dict(default_application="name")))
self.myassertRaisesRegex(SyntaxError, "invalid syntax",
load, data='x:y')
load, data='x::y')
self.myassertRaisesRegex(SyntaxError, "unknown key",
load, rdict=dict(BASE=dict(badkey="value")))
self.myassertRaisesRegex(SyntaxError, "BASE-only key",