File tree Expand file tree Collapse file tree 4 files changed +7
-10
lines changed Expand file tree Collapse file tree 4 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,8 @@ ignore = [
127127    " TCH002"  ,
128128    " PLW1514"  , #  allow Path.open without encoding
129129    " RET505"  , #  allow `else` blocks
130-     " RET506"   #  allow `else` blocks
130+     " RET506"  , #  allow `else` blocks
131+     " C901"    #  allow small if/else complexity
131132
132133]
133134select  = [
Original file line number Diff line number Diff line change @@ -162,13 +162,6 @@ def profile_generation_modes(self) -> List[ProfileGenerationMode]:
162162        if  self ._mode  in  ["constant" , "poisson" ]:
163163            return  [self ._mode ] *  len (self ._rates )
164164
165-         # WIP 
166-         # if self._mode in ["concurrent"]: 
167-         #     if self._rates is None: 
168-         #         raise ValueError("rate ") 
169- 
170-         #     return [self._mode] * int(self._rates[0]) 
171- 
172165        raise  ValueError (f"Invalid mode: { self ._mode }  " )
173166
174167    def  next (self , current_report : TextGenerationBenchmarkReport ) ->  Optional [Profile ]:
Original file line number Diff line number Diff line change @@ -316,7 +316,8 @@ def _completed(_task: asyncio.Task) -> None:
316316        if  self .mode  ==  "consistent" :
317317            if  self .rate  is  None :
318318                raise  ValueError (
319-                     "The rate must be specified in order to provide concurrent execution" 
319+                     "The `rate` must be specified in order to provide " 
320+                     "the concurrent execution" 
320321                )
321322            for  index , request  in  enumerate (self .generator ):
322323                while  (index  +  1  -  completed ) >=  settings .max_concurrency :
Original file line number Diff line number Diff line change @@ -14,17 +14,19 @@ def test_load_generator_mode():
1414        "constant" ,
1515        "poisson" ,
1616        "throughput" ,
17+         "consistent" ,
1718    }
1819
1920
2021@pytest .mark .smoke () 
2122@pytest .mark .parametrize ( 
2223    ("mode" , "rate" ), 
2324    [ 
25+         ("synchronous" , None ), 
2426        ("constant" , 10 ), 
2527        ("poisson" , 5 ), 
2628        ("throughput" , None ), 
27-         ("synchronous " , None ), 
29+         ("consistent " , 2 ), 
2830    ], 
2931) 
3032def  test_load_generator_instantiation (mode , rate ):
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments