Makes the Python imports consistently use full paths from the repository root,
unifying the behavior between Bazel and CMake This fixes one of the CI failures on Windows PiperOrigin-RevId: 417872531 Change-Id: I156989323b7e6d4a4420f4f9691b078829db933d
This commit is contained in:
		
				
					committed by
					
						
						Copybara-Service
					
				
			
			
				
	
			
			
			
						parent
						
							71d4e2f742
						
					
				
				
					commit
					c58f562fa2
				
			@@ -304,6 +304,8 @@ function(py_test name)
 | 
			
		||||
        COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
 | 
			
		||||
          --build_dir=${CMAKE_CURRENT_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE} ${ARGN})
 | 
			
		||||
    endif()
 | 
			
		||||
    # Make the Python import path consistent between Bazel and CMake.
 | 
			
		||||
    set_tests_properties(${name} PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_SOURCE_DIR})
 | 
			
		||||
  endif(PYTHONINTERP_FOUND)
 | 
			
		||||
endfunction()
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user