From 0ccb82204b8d04f8ffeb8b49a94fb77f981d1122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilja=20Everil=C3=A4?= Date: Thu, 5 Feb 2015 19:58:54 +0200 Subject: PY3 only test for function annotations --- pyramid/tests/test_config/test_util.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pyramid/tests/test_config/test_util.py b/pyramid/tests/test_config/test_util.py index bb61714ae..c9b0e9e9b 100644 --- a/pyramid/tests/test_config/test_util.py +++ b/pyramid/tests/test_config/test_util.py @@ -1,5 +1,5 @@ import unittest -from pyramid.compat import text_ +from pyramid.compat import text_, PY3 class TestPredicateList(unittest.TestCase): @@ -568,6 +568,14 @@ class Test_takes_one_arg(unittest.TestCase): foo = Foo() self.assertTrue(self._callFUT(foo.method)) + if PY3: + def test_function_annotations(self): + def foo(bar): + """ """ + # avoid SyntaxErrors in python2 + foo.__annotations__.update({'bar': 'baz'}) + self.assertTrue(self._callFUT(foo)) + class TestNotted(unittest.TestCase): def _makeOne(self, predicate): from pyramid.config.util import Notted -- cgit v1.2.3