Merge branch 'ilvalle-py36'

This commit is contained in:
mdipierro
2017-03-21 12:27:29 -05:00
3 changed files with 4 additions and 3 deletions
+1
View File
@@ -8,6 +8,7 @@ python:
- '2.7' - '2.7'
- 'pypy' - 'pypy'
- '3.5' - '3.5'
- '3.6'
install: install:
- pip install -e . - pip install -e .
+1 -1
View File
@@ -317,7 +317,7 @@ def load(routes='routes.py', app=None, data=None, rdict=None):
symbols = dict(app=app) symbols = dict(app=app)
try: try:
exec(data + '\n', symbols) exec(data, symbols)
except SyntaxError as e: except SyntaxError as e:
logger.error( logger.error(
'%s has a syntax error and will not be loaded\n' % path '%s has a syntax error and will not be loaded\n' % path
+2 -2
View File
@@ -95,14 +95,14 @@ class TestRouter(unittest.TestCase):
""" Test router syntax error """ """ Test router syntax error """
level = logger.getEffectiveLevel() level = logger.getEffectiveLevel()
logger.setLevel(logging.CRITICAL) # disable logging temporarily logger.setLevel(logging.CRITICAL) # disable logging temporarily
self.assertRaises(SyntaxError, load, data='x:y') self.assertRaises(SyntaxError, load, data='x::y')
self.assertRaises( self.assertRaises(
SyntaxError, load, rdict=dict(BASE=dict(badkey="value"))) SyntaxError, load, rdict=dict(BASE=dict(badkey="value")))
self.assertRaises(SyntaxError, load, rdict=dict( self.assertRaises(SyntaxError, load, rdict=dict(
BASE=dict(), app=dict(default_application="name"))) BASE=dict(), app=dict(default_application="name")))
self.myassertRaisesRegex(SyntaxError, "invalid syntax", self.myassertRaisesRegex(SyntaxError, "invalid syntax",
load, data='x:y') load, data='x::y')
self.myassertRaisesRegex(SyntaxError, "unknown key", self.myassertRaisesRegex(SyntaxError, "unknown key",
load, rdict=dict(BASE=dict(badkey="value"))) load, rdict=dict(BASE=dict(badkey="value")))
self.myassertRaisesRegex(SyntaxError, "BASE-only key", self.myassertRaisesRegex(SyntaxError, "BASE-only key",