diff --git a/test/test_evaluate/test_gradual/test_typeshed.py b/test/test_evaluate/test_gradual/test_typeshed.py new file mode 100644 index 00000000..fecca1ab --- /dev/null +++ b/test/test_evaluate/test_gradual/test_typeshed.py @@ -0,0 +1,14 @@ +import os + +import pytest + + +@pytest.mark.parametrize('code', ('import math', 'from math import cos')) +def test_math_is_stub(Script, code): + s = Script(code) + cos, = s.goto_definitions() + wanted = os.path.join('typeshed', 'stdlib', '2and3', 'math.pyi') + assert cos.module_path.endswith(wanted) + + cos, = s.goto_assignments() + assert cos.module_path.endswith(wanted)