Skip to content

Added doctests for fibonacci.py - #10836

Merged
cclauss merged 11 commits into
TheAlgorithms:masterfrom
nkstonks:master
Oct 29, 2023
Merged

Added doctests for fibonacci.py #10836
cclauss merged 11 commits into
TheAlgorithms:masterfrom
nkstonks:master

Conversation

@nkstonks

@nkstonksnkstonks commented Oct 23, 2023

Copy link
Copy Markdown
Contributor

Describe your change:

#9943

Added doctests for the fib_recursive_term function in maths/fibonacci.py

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Add or change doctests? -- Note: Please avoid changing both code and tests in a single pull request.
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".

@algorithms-keeperalgorithms-keeperBot added enhancement This PR modified some existing files awaiting reviews This PR is ready to be reviewed labels Oct 23, 2023
@nkstonks

Copy link
Copy Markdown
ContributorAuthor

Hold on, doctest seems to not be testing the function in question, I believe it's because it's a nested function. I'll need to figure something out for that.

Sorry for not checking this properly.

@nkstonksnkstonks reopened this Oct 24, 2023
@nkstonks

Copy link
Copy Markdown
ContributorAuthor

I closed this pull request as I realised doctest wasn't properly testing the function (fib_recursive_term) I implemented doctests for.

However I found out that doctests doesn't test local functions, which was the function I implemented doctests for.

So I'm reopening this pull request to ask whether we need to implement a way doctest will actually test that function, or just merge it anyways as the doctests are working (I've tested the function in a separte isolated file).

@algorithms-keeperalgorithms-keeperBot removed the awaiting reviews This PR is ready to be reviewed label Oct 29, 2023
@cclauss
cclauss merged commit 6b588e4 into TheAlgorithms:masterOct 29, 2023
@isidroasisidroas mentioned this pull request Jan 25, 2025
14 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementThis PR modified some existing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@nkstonks@cclauss