Skip to content

install required prior to running doctests #531

Closed

Description

@ghuls

doctest do not seem to work.

If you change the output of a doctest (so the output if invalid) and run the doctest command later, it still succeeds:

python run_tests.py doctest

Activity

  1. peterjc commented on Apr 28, 2015

    @peterjc
    Member

    I think this is something subtle about local files versus the installed files. If you reinstall Biopython after making your changes, does it then work?

  2. changed the title [-]doctest do not seem to work[/-] [+]install required prior to running doctests[/+] on Apr 28, 2015
  3. peterjc commented on Apr 28, 2015

    @peterjc
    Member

    It ought to work without installation. This issue is now the documentation for this bug.

  4. benfulton commented on Aug 24, 2018

    @benfulton
    Contributor

    Should doctest run without building (python setup.py build) ?

    If so, the doctests that rely on Bio._aligners must be discarded as they cannot work.

    If not, I think this issue can be closed. After building but without installing:

    $ python run_tests.py doctest
    Ran 77 tests in 3.950 seconds

  5. peterjc commented on Aug 24, 2018

    @peterjc
    Member

    Building without installing then testing ought to work:

    python setup.py build
    python setup.py test
    

    Or variations like this:

    python setup.py build
    cd Tests
    python run_tests.py doctest
    
    python setup.py build
    cd Tests
    python run_tests.py --offline doctest
    
  6. peterjc commented on Aug 24, 2018

    @peterjc
    Member

    The issue here is sometimes (and I never worked out when), rather than testing the newly built code in the build/ folder (which is what run_tests.py adds to the path), it uses the (typically older) code from an installed copy of Biopython.

    Does this work reliably for you?

    1. Remove any installed Biopython
    2. Install a really old Biopython
    3. Checkout the latest Biopython
    4. python setup.py build
    5. cd Tests
    6. python run_tests.py doctest
  7. benfulton commented on Aug 26, 2018

    @benfulton
    Contributor

    This seems to work. I used a Jetstream Ubuntu 18.04 image and installed BioPython 1.62 using Python 2.7.15rc1 and 3.6.5.

    77 doctests ran successfully in both cases using the latest BioPython. I then modified a Bio.Align doctest so it would fail, and rebuilt. The doctests successfully, well, failed :)

    The only thing that occurs to me is a namespace issue, either in the BioPython code or something caused by older versions of Python themselves. Either way, I think this issue should be closed.

  8. peterjc commented on Aug 27, 2018

    @peterjc
    Member

    Thanks for looking into this Ben - fingers crossed whatever caused this has been resolved.

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