From 087a58965bff1f9859bc4fb11e3fde96580c5057 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 10 Mar 2019 12:01:00 +0100 Subject: [PATCH] Add a typeshed test --- test/test_evaluate/test_gradual/test_typeshed.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/test_evaluate/test_gradual/test_typeshed.py 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)