@@ -118,13 +118,9 @@ def test_GivenLibraryAlreadyLoadedWhenCallingLoadZeLibraryThenReturnsEarly(self)
118118
119119 try :
120120 # This should return early without any library loading
121- with patch ("builtins.print" ) as mock_print :
122- self .pyzes ._LoadZeLibrary ()
123- # Should not print "Loading Linux library" because it returns early
124- print_calls = [
125- call .args [0 ] for call in mock_print .call_args_list if call .args
126- ]
127- self .assertNotIn ("Loading Linux library" , print_calls )
121+ self .pyzes ._LoadZeLibrary ()
122+ # Verify gpuLib remains unchanged (early return)
123+ self .assertEqual (self .pyzes .gpuLib , mock_lib )
128124 finally :
129125 # Restore original state
130126 self .pyzes .gpuLib = original_gpuLib
@@ -201,11 +197,10 @@ def test_GivenValidLibraryWhenGettingNewFunctionPointerThenCachesAndReturnsFunct
201197
202198 @patch ("sys.platform" , "win32" )
203199 @patch ("pyzes.gpuLib" , None )
204- @patch ("builtins.print" )
205200 @patch ("os.path.exists" )
206201 @patch ("pyzes.CDLL" )
207202 def test_GivenWindowsPlatformWhenLoadingLibraryThenLibraryIsLoaded (
208- self , mock_cdll , mock_exists , mock_print
203+ self , mock_cdll , mock_exists
209204 ):
210205 # Test Windows library loading path with deterministic mocking
211206 mock_exists .return_value = True
@@ -214,10 +209,9 @@ def test_GivenWindowsPlatformWhenLoadingLibraryThenLibraryIsLoaded(
214209
215210 self .pyzes ._LoadZeLibrary ()
216211
217- # Verify Windows-specific print was called
218- mock_print .assert_any_call ("Loading Windows library" )
219212 # Verify successful library loading
220213 mock_cdll .assert_called ()
214+ self .assertIsNotNone (self .pyzes .gpuLib )
221215
222216
223217if __name__ == "__main__" :
0 commit comments