Skip to content

Commit 6ad9499

Browse files
committed
doctest: some missing type annotations
1 parent 2ed2e92 commit 6ad9499

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/_pytest/doctest.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -400,17 +400,17 @@ def _get_flag_lookup() -> Dict[str, int]:
400400
)
401401

402402

403-
def get_optionflags(parent):
404-
optionflags_str = parent.config.getini("doctest_optionflags")
403+
def get_optionflags(config: Config) -> int:
404+
optionflags_str = config.getini("doctest_optionflags")
405405
flag_lookup_table = _get_flag_lookup()
406406
flag_acc = 0
407407
for flag in optionflags_str:
408408
flag_acc |= flag_lookup_table[flag]
409409
return flag_acc
410410

411411

412-
def _get_continue_on_failure(config):
413-
continue_on_failure = config.getvalue("doctest_continue_on_failure")
412+
def _get_continue_on_failure(config: Config) -> bool:
413+
continue_on_failure: bool = config.getvalue("doctest_continue_on_failure")
414414
if continue_on_failure:
415415
# We need to turn off this if we use pdb since we should stop at
416416
# the first failure.
@@ -433,7 +433,7 @@ def collect(self) -> Iterable[DoctestItem]:
433433
name = self.path.name
434434
globs = {"__name__": "__main__"}
435435

436-
optionflags = get_optionflags(self)
436+
optionflags = get_optionflags(self.config)
437437

438438
runner = _get_runner(
439439
verbose=False,
@@ -578,7 +578,7 @@ def _from_module(self, module, object):
578578
raise
579579
# Uses internal doctest module parsing mechanism.
580580
finder = MockAwareDocTestFinder()
581-
optionflags = get_optionflags(self)
581+
optionflags = get_optionflags(self.config)
582582
runner = _get_runner(
583583
verbose=False,
584584
optionflags=optionflags,

0 commit comments

Comments
 (0)