@pytest.mark.skipif('sys.version_info[0] < 3')
def test_simple_annotations():
 source = dedent("    def annot(a:3):\n        return a\n\n    annot('')")
 assert ([d.name for d in jedi.Script(source).goto_definitions()] == ['str'])
 source = dedent("\n    def annot_ret(a:3) -> 3:\n        return a\n\n    annot_ret('')")
 assert ([d.name for d in jedi.Script(source).goto_definitions()] == ['str'])
 source = dedent("    def annot(a:int):\n        return a\n\n    annot('')")
 assert ([d.name for d in jedi.Script(source).goto_definitions()] == ['int'])

@ pytest . mark . skipif ( 'sys.version_info[0] < 3' ) def test_simple_annotations ( ) : source = dedent ( "    def annot(a:3):\n        return a\n\n    annot('')" ) assert ( [ d . name for d in jedi . Script ( source ) . goto_definitions ( ) ] == [ 'str' ] ) source = dedent ( "\n    def annot_ret(a:3) -> 3:\n        return a\n\n    annot_ret('')" ) assert ( [ d . name for d in jedi . Script ( source ) . goto_definitions ( ) ] == [ 'str' ] ) source = dedent ( "    def annot(a:int):\n        return a\n\n    annot('')" ) assert ( [ d . name for d in jedi . Script ( source ) . goto_definitions ( ) ] == [ 'int' ] )
annotations only exist in python 3 .