Add a typeshed test

This commit is contained in:
Dave Halter
2019-03-10 12:01:00 +01:00
parent b7a164afa8
commit 087a58965b

View File

@@ -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)