Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 11 commits into from
Dec 9, 2016
Merged

Significantly improve test coverage #3

merged 11 commits into from
Dec 9, 2016

Conversation

astrofrog
Copy link
Member

@astrofrog astrofrog commented Dec 9, 2016

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)

…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
@coveralls
Copy link

coveralls commented Dec 9, 2016

Coverage Status

Coverage increased (+48.8%) to 82.215% when pulling 7591608 on test-cases into 496e818 on master.

@bsipocz
Copy link
Member

bsipocz commented Dec 9, 2016

@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?

@bsipocz
Copy link
Member

bsipocz commented Dec 9, 2016

(I don't even mean the tests, but the actual fixes only).

@astrofrog astrofrog mentioned this pull request Dec 9, 2016
@astrofrog
Copy link
Member Author

@bsipocz - not serious at all, I don't think those corner cases are present in the astropy docs for instance

Copy link
Member

@eteq eteq left a 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'])
Copy link
Member

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.

@astrofrog astrofrog merged commit 9599363 into master Dec 9, 2016
@saimn
Copy link
Contributor

saimn commented Dec 12, 2016

@astrofrog :

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.

This looks similar to astropy/astropy-helpers#243 in which I had an issue with :no-main-docstr:, and .. currentmodule: was not working correctly. Your workaround is b4ea013 ? I don't have time for this now, but when I can I will test if it changes something.

@astrofrog
Copy link
Member Author

@saimn - yes, that is my workaround for that bug

astrofrog added a commit that referenced this pull request Jan 27, 2018
Significantly improve test coverage
astrofrog added a commit that referenced this pull request Jan 27, 2018
Significantly improve test coverage
@pllim pllim deleted the test-cases branch December 22, 2021 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants