Enable doctests for python setup.py test#101
Conversation
|
I've asked this question on astropy-dev and @mdboom and @eteq have commented: |
|
Filed Astropy issue: astropy/astropy#2364 |
|
Currently the following doctests fail: |
|
Currently I'm getting these fails: https://gist.github.com/cdeil/97038aee3cf3bb5d48cb |
|
I've rebased, new builds running here: https://travis-ci.org/gammapy/gammapy/builds/232939654 Locally I tried but no extra lines listing if / which doctests ran. So I don't know if it's active or not. @bsipocz - Can you please review the travis-ci log at https://travis-ci.org/gammapy/gammapy/jobs/232939668 (the "main" build we use for coverage) when ready and comment whether doctests are running or not (and how to tell)? |
|
@cdeil - I'll have a look at it once I'm at home. |
|
travis-ci tests passed, but I don't see any docs tests running in the log locally or on travis-ci. |
|
@cdeil - I'm assigning myself here, too, so it's more likely that I won't forget to get back to it. |
|
This needs a rebase. After that I see at least 10 errors and expect several failures, too, but none of the should be substantial. |
|
Doctests are now run as part of the CI build: https://github.com/gammapy/gammapy/blob/master/.github/workflows/ci.yml#L127, locally they can be run using the same command. Will close the PR now... |
This is a continuation of #95 ... I didn't realise merging those commits manually into master would close that github issue. Copy of issue description in one of the comments there ...
I fixed most doctests ... what remains to be done is to configure the doctest runner to skip the following files:
gammapy/data/poisson_stats_image/fit_sherpa.pygammapy/data/poisson_stats_image/simulate_data.pygammapy/docs/background/estimate_significance_image.pygammapy/docs/tutorials/image/sherpa_fit_image.pydocs//image/colormap_example.pyThe first four contain imports or non-functioning code and should not be executed.
The last one causes the tests to hang because a matplotlib figure pops up and has to be closed by hand.
I don't know how I can configure the test runner to skip these files entirely?
I currently have this in my
setup.cfg:I tried putting
__doctest_skip__ = ['*']at the top of these files or adding their filenamesnorecuredirslist insetup.cfg... but this doesn't work.