Skip to content

TST: fix misc. doctest failures (test_doc.py)#463

Merged
rgommers merged 4 commits into
PyWavelets:masterfrom
grlee77:test_doc_fix
Mar 17, 2019
Merged

TST: fix misc. doctest failures (test_doc.py)#463
rgommers merged 4 commits into
PyWavelets:masterfrom
grlee77:test_doc_fix

Conversation

@grlee77
Copy link
Copy Markdown
Contributor

@grlee77 grlee77 commented Feb 15, 2019

test_doc.py was apparently not being run on the CI services and had a number of failures.

nosetests skips the tests in this file, so run it separately.
@grlee77
Copy link
Copy Markdown
Contributor Author

grlee77 commented Feb 15, 2019

Thanks to @rafat for pointing out the issue in openjournals/joss-reviews#1237

It seems that nosetests was skipping test_doc.py entirely, so I modified the .travis.yml to run the tests in this file with a separate python call.

This is necessary for running 'make doctest' sucessfully from the doc subfolder
@grlee77
Copy link
Copy Markdown
Contributor Author

grlee77 commented Mar 16, 2019

If I don't hear any objections I'll go ahead and merge this one soon.

I'm not a fan of doctests in general, but since we have them currently, we should run them on CI to make sure they don't get out of date like this in the future.

@rgommers rgommers merged commit 0136844 into PyWavelets:master Mar 17, 2019
@rgommers
Copy link
Copy Markdown
Member

Thanks @grlee77. All green, so helpful for now.

I'm not a fan of doctests in general, but since we have them currently, we should run them on CI to make sure they don't get out of date like this in the future.

Agreed. I actually like examples in doctest format, the problem is just that doctest itself is terrible. https://github.com/scipy/scipy/blob/master/tools/refguide_check.py fixes that. we can copy that at some point if needed (or wait till it gets turned in a standalone package).

@grlee77
Copy link
Copy Markdown
Contributor Author

grlee77 commented Mar 17, 2019

https://github.com/scipy/scipy/blob/master/tools/refguide_check.py fixes that. we can copy that at some point if needed (or wait till it gets turned in a standalone package).

Actually we already have it in util/refguide_check.py and one of the Travis cases calls it, but perhaps it is not configured correctly? It currently only seems to check the examples in the demos folder, but doesn't actually seem to run any doctests.

@rgommers
Copy link
Copy Markdown
Member

Ah good catch. It will need the --doctests flag.

@grlee77
Copy link
Copy Markdown
Contributor Author

grlee77 commented Mar 17, 2019

Ah good catch. It will need the --doctests flag.

I tried that, but it doesn't seem to do anything. The full output is

Running checks for 0 modules:
Checking examples files at /home/lee8rx/my_git/pyir/pywt/doc/source/regression/*.rst:

dwt-idwt.rst .
gotchas.rst .
index.rst .
modes.rst .
multilevel.rst .
wavelet.rst .
wp.rst .
wp2d.rst .

OK: refguide and doctests checks passed!

For comparison, python pywt/tests/test_doc.py outputs

.........................................
----------------------------------------------------------------------
Ran 41 tests in 0.039s

OK

Finally there is the ability to run make doctest from within the doc folder. I don't think this is currently done on CI, but the summary produced by that is:

Doctest summary
===============
  379 tests
    0 failures in tests
    0 failures in setup code
    0 failures in cleanup code

I think it is more than the above mainly due to inclusion of additional regression tests from doc/source/regression/

@rgommers rgommers added this to the v1.1 milestone Mar 19, 2019
@grlee77 grlee77 deleted the test_doc_fix branch November 13, 2019 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants