Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 52ce851

Browse files
authored
Make tests suite with the typeshed in the PyPI tarball. (#138)
Apparently, tests/test.py expects different typeshed than what’s included in the tarball from PyPI.
1 parent 70bb6de commit 52ce851

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
TEST_TYPESHED = Path(__file__).parent / "typeshed"
1818
PACKAGES = Path(__file__).parent / "site-packages"
19+
HAS_TEST_FIXTURES = TEST_TYPESHED.exists() and PACKAGES.exists()
1920

2021

2122
def get_context(
@@ -30,6 +31,7 @@ def get_context(
3031
)
3132

3233

34+
@unittest.skipUnless(HAS_TEST_FIXTURES, "test fixtures are not shipped in the sdist")
3335
class TestFinder(unittest.TestCase):
3436
def check(
3537
self,
@@ -81,6 +83,7 @@ def test_get_all_stub_files(self) -> None:
8183
)
8284

8385

86+
@unittest.skipUnless(HAS_TEST_FIXTURES, "test fixtures are not shipped in the sdist")
8487
class TestParser(unittest.TestCase):
8588
def test_get_stub_names(self) -> None:
8689
ctx = get_context((3, 5))
@@ -302,6 +305,7 @@ def test_overloads(self) -> None:
302305
self.assertIsInstance(defn, ast.FunctionDef)
303306

304307

308+
@unittest.skipUnless(HAS_TEST_FIXTURES, "test fixtures are not shipped in the sdist")
305309
class TestResolver(unittest.TestCase):
306310
def test_simple(self) -> None:
307311
res = typeshed_client.Resolver(get_context((3, 5)))
@@ -362,6 +366,7 @@ def test_use_py_file(self) -> None:
362366
self.assertIsNone(obj)
363367

364368

369+
@unittest.skip("integration test depends on ambient site-packages in the build root")
365370
class IntegrationTest(unittest.TestCase):
366371
"""Tests that all files in typeshed are parsed without error.
367372

0 commit comments

Comments
 (0)