You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
exclude rather than include doctests in "run_tests.py doctest" #1904
The testing code in Tests/run_tests.py that does doctests relies on people updating the list of modules to test. @peterjc in #1901 (comment)_:
Perhaps rather a positive list like this, we can switch to testing them all by default and listing modules to exclude from doctests.
A solution would be to call pkgutil.iter_modules recursively to get all modules, then exclude all which should not be tested. This way the resulting list may contain modules without doctests, only discovered when later parsing the file and running the test. However determining if a file contains a test requires parsing anyway, so there is no performance gain in excluding files without doctest right at the start.
changed the title [-]blacklist instead of whitelist for "run_tests.py doctest"[/-][+]exclude rather than include doctests in "run_tests.py doctest"[/+]on Jan 22, 2019
It might be possible to query our setup.py which has the definitive list of packages - although separately we should be able to move away from that in favour of from setuptools import find_packages (which wasn't available in the early years of Biopython, and only relatively recently have we required setuptools as a dependency).
... in favour of from setuptools import find_packages
I'll use this, thanks. find_packages seems the most correct way to find packages. To find submodules of each package I'll use pkgutil.iter_modules. This way no assumptions on file type are made.
Actually there are appveyor failures if a file has no docstring at all. I consider it a feature and will open a ticket with those files when I can figure out how to reproduce it.
Activity
[-]blacklist instead of whitelist for "run_tests.py doctest"[/-][+]exclude rather than include doctests in "run_tests.py doctest"[/+]peterjc commentedon Jan 22, 2019
Retitled to avoid the loaded term blacklist.
peterjc commentedon Jan 22, 2019
It might be possible to query our
setup.pywhich has the definitive list of packages - although separately we should be able to move away from that in favour offrom setuptools import find_packages(which wasn't available in the early years of Biopython, and only relatively recently have we requiredsetuptoolsas a dependency).rwst commentedon Jan 22, 2019
I'll use this, thanks.
find_packagesseems the most correct way to find packages. To find submodules of each package I'll usepkgutil.iter_modules. This way no assumptions on file type are made.exclude rather than include doctests in "run_tests.py doctest" biopyt…
rwst commentedon Jan 23, 2019
Actually there are appveyor failures if a file has no docstring at all. I consider it a feature and will open a ticket with those files when I can figure out how to reproduce it.
peterjc commentedon Jan 23, 2019
Maybe open the issue now (or add the appveyor links and log excerpts here) without waiting to figure out how to reproduce it locally?
Update: See #1906 (comment)
exclude rather than include doctests in "run_tests.py doctest"
peterjc commentedon Mar 19, 2019
Closing this issue now that #1906 has been merged.