@@ -219,14 +219,12 @@ def test_list_compared_to_string(self):
219219 def test_as_list_with_valid_checkpoint_interval_options (self ):
220220 """Test the checkpoint interval options."""
221221 options = self .default_options
222- options .num_threads = os . cpu_count ()
222+ options .num_threads = 1
223223 options .checkpoint_interval = 10
224224 options .checkpoint_file = "checkpoint.h5"
225225
226226 options_list = options .as_list (self .mock_sensor )
227227 expected_elements = [
228- "-t" ,
229- str (os .cpu_count ()),
230228 "--checkpoint_interval" ,
231229 "10" ,
232230 "--checkpoint_file" ,
@@ -236,19 +234,20 @@ def test_as_list_with_valid_checkpoint_interval_options(self):
236234 "-s" ,
237235 "10" ,
238236 ]
237+ if not PLATFORM == "windows" :
238+ expected_elements .insert (0 , "-t" )
239+ expected_elements .insert (1 , f"1" )
239240 self .assertListEqual (expected_elements , options_list )
240241
241242 def test_as_list_with_valid_checkpoint_timesteps_options (self ):
242243 """Test the checkpoint interval options."""
243244 options = self .default_options
244- options .num_threads = os . cpu_count ()
245+ options .num_threads = 1
245246 options .checkpoint_timesteps = 10
246247 options .checkpoint_file = "checkpoint.h5"
247248
248249 options_list = options .as_list (self .mock_sensor )
249250 expected_elements = [
250- "-t" ,
251- str (os .cpu_count ()),
252251 "--checkpoint_timesteps" ,
253252 "10" ,
254253 "--checkpoint_file" ,
@@ -258,6 +257,9 @@ def test_as_list_with_valid_checkpoint_timesteps_options(self):
258257 "-s" ,
259258 "10" ,
260259 ]
260+ if not PLATFORM == "windows" :
261+ expected_elements .insert (0 , "-t" )
262+ expected_elements .insert (1 , f"1" )
261263 self .assertListEqual (expected_elements , options_list )
262264
263265
0 commit comments