1616
1717TEST_TYPESHED = Path (__file__ ).parent / "typeshed"
1818PACKAGES = Path (__file__ ).parent / "site-packages"
19+ HAS_TEST_FIXTURES = TEST_TYPESHED .exists () and PACKAGES .exists ()
1920
2021
2122def 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" )
3335class 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" )
8487class 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" )
305309class 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" )
365370class IntegrationTest (unittest .TestCase ):
366371 """Tests that all files in typeshed are parsed without error.
367372
0 commit comments