@@ -283,13 +283,13 @@ def test_submit(make_job, exec_ctx):
283283def test_submit_timelimit (minimal_job , local_only ):
284284 minimal_job .time_limit = '2s'
285285 prepare_job (minimal_job , 'sleep 10' )
286- t_job = datetime . now ()
286+ t_job = time . time ()
287287 minimal_job .submit ()
288288 assert minimal_job .jobid is not None
289289 minimal_job .wait ()
290- t_job = datetime . now () - t_job
291- assert t_job . total_seconds () >= 2
292- assert t_job . total_seconds () < 3
290+ t_job = time . time () - t_job
291+ assert t_job >= 2
292+ assert t_job < 3
293293 with open (minimal_job .stdout ) as fp :
294294 assert re .search ('postrun' , fp .read ()) is None
295295
@@ -319,7 +319,7 @@ def test_submit_job_array(make_job, slurm_only, exec_ctx):
319319def test_cancel (make_job , exec_ctx ):
320320 minimal_job = make_job (sched_access = exec_ctx .access )
321321 prepare_job (minimal_job , 'sleep 30' )
322- t_job = datetime . now ()
322+ t_job = time . time ()
323323 minimal_job .submit ()
324324 minimal_job .cancel ()
325325
@@ -331,9 +331,9 @@ def test_cancel(make_job, exec_ctx):
331331 time .sleep (0.01 )
332332
333333 minimal_job .wait ()
334- t_job = datetime . now () - t_job
334+ t_job = time . time () - t_job
335335 assert minimal_job .finished ()
336- assert t_job . total_seconds () < 30
336+ assert t_job < 30
337337
338338 # Additional scheduler-specific checks
339339 sched_name = minimal_job .scheduler .registered_name
0 commit comments