@@ -444,21 +444,26 @@ def many_open_sockets(request, resource_limit):
444444
445445
446446@pytest .mark .parametrize (
447- ('minthreads' , 'maxthreads' ),
447+ ('minthreads' , 'maxthreads' , 'inited_maxthreads' ),
448448 (
449- (1 , - 2 ), # the docstring only mentions -1 to mean "no max", but other
450- # negative numbers should also work
451- (1 , - 1 ),
452- (1 , 1 ),
453- (1 , 2 ),
454- (1 , float ('inf' )),
455- (2 , - 2 ),
456- (2 , - 1 ),
457- (2 , 2 ),
458- (2 , float ('inf' )),
449+ (
450+ # NOTE: The docstring only mentions -1 to mean "no max", but other
451+ # NOTE: negative numbers should also work.
452+ 1 ,
453+ - 2 ,
454+ float ('inf' ),
455+ ),
456+ (1 , - 1 , float ('inf' )),
457+ (1 , 1 , 1 ),
458+ (1 , 2 , 2 ),
459+ (1 , float ('inf' ), float ('inf' )),
460+ (2 , - 2 , float ('inf' )),
461+ (2 , - 1 , float ('inf' )),
462+ (2 , 2 , 2 ),
463+ (2 , float ('inf' ), float ('inf' )),
459464 ),
460465)
461- def test_threadpool_threadrange_set (minthreads , maxthreads ):
466+ def test_threadpool_threadrange_set (minthreads , maxthreads , inited_maxthreads ):
462467 """Test setting the number of threads in a ThreadPool.
463468
464469 The ThreadPool should properly set the min+max number of the threads to use
@@ -470,10 +475,7 @@ def test_threadpool_threadrange_set(minthreads, maxthreads):
470475 max = maxthreads ,
471476 )
472477 assert tp .min == minthreads
473- if maxthreads < 0 :
474- assert tp .max == float ('inf' )
475- else :
476- assert tp .max == maxthreads
478+ assert tp .max == inited_maxthreads
477479
478480
479481@pytest .mark .parametrize (
0 commit comments