1717storage or a body lives behind rt.hpp, which only _rt.pyx names.
1818"""
1919
20+ import os
2021import re
2122from pathlib import Path
2223
2324import pytest
2425
26+ _skip_if_source_tree_unavailable = pytest .mark .skipif (
27+ os .environ .get ("CUDA_CORE_TEST_SKIP_SOURCE_TREE_TESTS" ) == "1" ,
28+ reason = "cuda.core source tree is unavailable in this test environment" ,
29+ )
30+
2531CORE = Path (__file__ ).resolve ().parent .parent / "cuda" / "core"
2632RT = CORE / "_cpp" / "rt"
2733HEADERS = sorted (RT .glob ("*.hpp" ))
@@ -51,12 +57,14 @@ def include_closure(path):
5157 return sorted (seen )
5258
5359
60+ @_skip_if_source_tree_unavailable
5461@pytest .mark .agent_authored (model = "claude-fable-5-1" )
5562def test_python_h_is_spelled_only_in_py_hpp ():
5663 spellers = [p .name for p in HEADERS + SOURCES if "<Python.h>" in read (p )]
5764 assert spellers == ["py.hpp" ]
5865
5966
67+ @_skip_if_source_tree_unavailable
6068@pytest .mark .agent_authored (model = "claude-fable-5-1" )
6169def test_neutral_files_do_not_name_python ():
6270 """Every header except the seam and the umbrellas, and every source that does
@@ -76,6 +84,7 @@ def test_in_tree_includes_are_bare_sibling_names_that_exist():
7684 assert (RT / name ).is_file (), f"{ path .name } includes { name !r} , which does not exist"
7785
7886
87+ @_skip_if_source_tree_unavailable
7988@pytest .mark .agent_authored (model = "claude-fable-5-1" )
8089def test_umbrellas_are_named_only_by_their_cython_file ():
8190 for path in HEADERS + SOURCES :
@@ -87,6 +96,7 @@ def test_umbrellas_are_named_only_by_their_cython_file():
8796 assert named == {"_cpp/rt/rt.hpp" : {"_rt.pyx" }, "_cpp/rt/handles.hpp" : {"_rt.pxd" }}
8897
8998
99+ @_skip_if_source_tree_unavailable
90100@pytest .mark .agent_authored (model = "claude-fable-5-1" )
91101def test_consumer_closure_is_types_and_the_python_seam ():
92102 closure = {p .name for p in include_closure (RT / "handles.hpp" )}
@@ -98,6 +108,7 @@ def test_consumer_closure_is_types_and_the_python_seam():
98108 assert not re .search (r"^(static|thread_local)\b" , text , re .M ), f"{ name } defines storage"
99109
100110
111+ @_skip_if_source_tree_unavailable
101112@pytest .mark .agent_authored (model = "claude-fable-5-1" )
102113def test_pxd_functions_are_not_called_by_name_inside_the_module ():
103114 """Cython emits a static prototype for each cdef function the .pxd declares, so
0 commit comments