From b036c88b7306a607d736eebea87e70facc6ab6ad Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 6 Mar 2015 00:42:57 +0100 Subject: [PATCH] True in Python 2 is still not a keyword, but a name. --- test/test_api/test_api.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/test_api/test_api.py b/test/test_api/test_api.py index 4e651e6d..926f41a2 100644 --- a/test/test_api/test_api.py +++ b/test/test_api/test_api.py @@ -5,6 +5,7 @@ Test all things related to the ``jedi.api`` module. from textwrap import dedent from jedi import api +from jedi._compatibility import is_py3 from pytest import raises @@ -105,7 +106,11 @@ def test_goto_assignments_on_non_name(): assert api.Script('for').goto_assignments() == [] assert api.Script('assert').goto_assignments() == [] - assert api.Script('True').goto_assignments() == [] + if is_py3: + assert api.Script('True').goto_assignments() == [] + else: + # In Python 2.7 True is still a name. + assert api.Script('True').goto_assignments()[0].description == 'class bool' def test_goto_definitions_on_non_name():