-
-
Notifications
You must be signed in to change notification settings - Fork 48
Significantly improve test coverage #3
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
Conversation
…luding reference output files that can be compared with the input files.
…ue to the :no-main-docstr: option), the autosummary directive did not recognize that it was in the correct module.
…kip: option passes to automodapi (classes that are skipped in the API docs should not be included in the diagram)
…grams of classes and when classes are imported from a different file into a module
@astrofrog - How serious are the issues you've fixed? Would you consider putting the changes back to helpers for v1.3, even if we go ahead with the standalone module? |
(I don't even mean the tests, but the actual fixes only). |
@bsipocz - not serious at all, I don't think those corner cases are present in the astropy docs for instance |
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.
One concern inline, but it's not really actionable, just an FYI. So LGTM!
|
||
try: | ||
os.chdir(src_dir) | ||
status = build_main(argv=['sphinx-build', '-W', '-b', 'html', '.', 'build/_html']) |
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.
This worries me a little: in some past experiments with sphinx, when I've tried to do this in the same process, occasionally (and unpredictably) sphinx will "fail hard" with something like a sys.exit. I'm not sure if pytest will catch that or not, and I'm not sure when it happens, so I don't know if there's anything to be done about this. But we should just beware that this might be a problem down the road.
This looks similar to astropy/astropy-helpers#243 in which I had an issue with |
@saimn - yes, that is my workaround for that bug |
Significantly improve test coverage
Significantly improve test coverage
This involved creating a number of test cases with reference input and output so that we can run the doc build with the input and make sure we get the correct output. This increases the test coverage from 33% to 82%.
In the process, I discovered a couple of small bugs (as one always does when increasing test coverage!)
If
:no-main_docstr:
is not specified, this leads to errors when processing autosummary directives because the currentmodule doesn't appear to have an effect. There was a workaround for this based on comments in the code, but I had to add an extra workaround to get it to work for me.The inheritance diagram should not show skipped classes, so I've fixed this
@eteq - if we decide to abandon this standalone version, I'll make sure we pull the changes back to astropy-helpers. Feel free to leave comments on this if you like!
Even though this looks like a lot of changes, most are self-contained new files that could easily be copied back to astropy-helpers if needed.
(oops, meant to open this from a branch on my fork)