doctest: some missing type annotations
This commit is contained in:
		
							parent
							
								
									2ed2e9208d
								
							
						
					
					
						commit
						6ad9499c9c
					
				| 
						 | 
					@ -400,8 +400,8 @@ def _get_flag_lookup() -> Dict[str, int]:
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def get_optionflags(parent):
 | 
					def get_optionflags(config: Config) -> int:
 | 
				
			||||||
    optionflags_str = parent.config.getini("doctest_optionflags")
 | 
					    optionflags_str = config.getini("doctest_optionflags")
 | 
				
			||||||
    flag_lookup_table = _get_flag_lookup()
 | 
					    flag_lookup_table = _get_flag_lookup()
 | 
				
			||||||
    flag_acc = 0
 | 
					    flag_acc = 0
 | 
				
			||||||
    for flag in optionflags_str:
 | 
					    for flag in optionflags_str:
 | 
				
			||||||
| 
						 | 
					@ -409,8 +409,8 @@ def get_optionflags(parent):
 | 
				
			||||||
    return flag_acc
 | 
					    return flag_acc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _get_continue_on_failure(config):
 | 
					def _get_continue_on_failure(config: Config) -> bool:
 | 
				
			||||||
    continue_on_failure = config.getvalue("doctest_continue_on_failure")
 | 
					    continue_on_failure: bool = config.getvalue("doctest_continue_on_failure")
 | 
				
			||||||
    if continue_on_failure:
 | 
					    if continue_on_failure:
 | 
				
			||||||
        # We need to turn off this if we use pdb since we should stop at
 | 
					        # We need to turn off this if we use pdb since we should stop at
 | 
				
			||||||
        # the first failure.
 | 
					        # the first failure.
 | 
				
			||||||
| 
						 | 
					@ -433,7 +433,7 @@ class DoctestTextfile(Module):
 | 
				
			||||||
        name = self.path.name
 | 
					        name = self.path.name
 | 
				
			||||||
        globs = {"__name__": "__main__"}
 | 
					        globs = {"__name__": "__main__"}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        optionflags = get_optionflags(self)
 | 
					        optionflags = get_optionflags(self.config)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        runner = _get_runner(
 | 
					        runner = _get_runner(
 | 
				
			||||||
            verbose=False,
 | 
					            verbose=False,
 | 
				
			||||||
| 
						 | 
					@ -578,7 +578,7 @@ class DoctestModule(Module):
 | 
				
			||||||
                    raise
 | 
					                    raise
 | 
				
			||||||
        # Uses internal doctest module parsing mechanism.
 | 
					        # Uses internal doctest module parsing mechanism.
 | 
				
			||||||
        finder = MockAwareDocTestFinder()
 | 
					        finder = MockAwareDocTestFinder()
 | 
				
			||||||
        optionflags = get_optionflags(self)
 | 
					        optionflags = get_optionflags(self.config)
 | 
				
			||||||
        runner = _get_runner(
 | 
					        runner = _get_runner(
 | 
				
			||||||
            verbose=False,
 | 
					            verbose=False,
 | 
				
			||||||
            optionflags=optionflags,
 | 
					            optionflags=optionflags,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue