Skip to content

Nested functions can't be tested by doctest  #10837

@nkstonks

Description

@nkstonks

Feature description

#9943

So I was adding doctests to a nested function in fibonacci.py, however doctest doesn't seem to be testing that function.

The function in this case is fib_recursive_term(), that's nested inside fib_recursive, as seen below:
image
Note: the 5 doctests for fib_recursive_term() is what I added.

If I run the doctests, I get this output below.
As per the output below, 5 tests for fib_recursive() runs, but the 5 tests for fib_recursive_term() doesn't.
image

So I want to propose taking the fib_recursive_term() function out of the fib_recursive() function and have it defined above it, so doctests actually goes through it. Would there be any issues there?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThis PR modified some existing files

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions