summaryrefslogtreecommitdiff
path: root/tests/errors/cimport_attributes.pyx
blob: 53e303a424f20011b593c35783a73b46d3110d64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# mode: error


cimport libcpp
print libcpp.no_such_attribute

cimport libcpp.map
print libcpp.map.no_such_attribute

from libcpp cimport vector
print vector.no_such_attribute

from libcpp cimport vector as my_vector
print my_vector.no_such_attribute

from libcpp cimport vector as my_vector_with_shadow
from libcpp import vector as my_vector_with_shadow
print my_vector_with_shadow.python_attribute   # OK (if such a module existed at runtime)

# Other ordering
from libcpp import map as my_map_with_shadow
from libcpp cimport map as my_map_with_shadow
print my_map_with_shadow.python_attribute   # OK (if such a module existed at runtime)


_ERRORS = u"""
5:12: cimported module has no attribute 'no_such_attribute'
8:16: cimported module has no attribute 'no_such_attribute'
11:12: cimported module has no attribute 'no_such_attribute'
14:15: cimported module has no attribute 'no_such_attribute'
"""