Skip to content

exclude rather than include doctests in "run_tests.py doctest" #1904

Closed

Description

@rwst

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.

Activity

  1. 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
  2. peterjc commented on Jan 22, 2019

    @peterjc
    Member

    Retitled to avoid the loaded term blacklist.

  3. peterjc commented on Jan 22, 2019

    @peterjc
    Member

    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).

  4. rwst commented on Jan 22, 2019

    @rwst
    ContributorAuthor

    ... 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.

  5. rwst commented on Jan 23, 2019

    @rwst
    ContributorAuthor

    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.

  6. peterjc commented on Jan 23, 2019

    @peterjc
    Member

    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)

  7. peterjc commented on Mar 19, 2019

    @peterjc
    Member

    Closing this issue now that #1906 has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions