-
Notifications
You must be signed in to change notification settings - Fork 27.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run doctest for new files #25588
Run doctest for new files #25588
Conversation
utils/tests_fetcher.py
Outdated
x for x in test_files_to_run if x in documentation_tests and x not in slow_documentation_tests | ||
x | ||
for x in test_files_to_run | ||
if x in new_files or (x in documentation_tests and x not in slow_documentation_tests) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new files are always added
The documentation is not available anymore as the PR was closed or merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this. It would be better to either:
a) reverse the list in the doctest file to include the files not tested yet (cause the docstrings haven't been fixed yet) in which case new files are automatically tested
or
b) put a check in the utils that checks the doctest file is properly sorted to make sure it includes new files
Either way, the new files would be always tested afterward (whereas here they are only tested when added). My preference goes for a if it's not too much work.
@ArthurZucker also mentioned |
826355b
to
3acc08e
Compare
utils/tests_fetcher.py
Outdated
# Do not run slow doctest tests | ||
with open("utils/slow_documentation_tests.txt") as fp: | ||
slow_documentation_tests = set(fp.read().strip().split("\n")) | ||
|
||
# So far we don't have 100% coverage for doctest. This line will be removed once we achieve 100%. | ||
test_files_to_run = [ | ||
x for x in test_files_to_run if x in documentation_tests and x not in slow_documentation_tests | ||
x for x in test_files_to_run if x not in not_doctested and x not in slow_documentation_tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The files slow_documentation_tests
won't be in not_doctested
- they are doctested, but only on daily CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
once PR approved, I will remove the file documentation_list.txt
Added a (so far on I would prefer to separate that work from this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think that init
files for example have anydoctest, so should probably not be here, and would prefer if only files that have doc example be here! (tests/* probably don't no?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for diving into this! I think we can have stricter rules: only look in the english doc for md files and only in the src fodler for .py files. Everything else will never be doc-tested, and this will make the not_doctested file easier to read.
Also please include this file in the doctest_file check (so it's always sorted in alphabetical order).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better! Fine for me 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for iterating!
95d4310
to
e05d404
Compare
6c5558a
to
18fe148
Compare
I am going to merge this PR without removing Will do it in a follow up PR. |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
fix Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
fix Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
fix Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
What does this PR do?
The effect could be see in this run (see the artifact).
From Sir @ArthurZucker