[Biopython-dev] testseq update (6/13/17)

Adil Iqbal aiqbal85 at gmail.com
Tue Jun 13 07:30:28 UTC 2017


*TL:DR - Importing issue solved by 'manually_import' function. It can be
used to solve similar problems in the future. Decided to remove non-Bio
doctest for problematic versions of python. Open to
input/suggestions/criticisms. Thank you.*

Hello all,

I have solved the 'testseq' importing issue.

Since I could not import 'testseq' directly, I wrote a function that could
manually import 'testseq' into the 'test_testseq' unit test using the
built-in module 'importlib'. The function, named 'manually_import,' is
generalized to work for any future unit tests for modules outside the 'Bio'
package. You can see the code in isolation here:
https://github.com/Adil-Iqbal/Personal-Projects/blob/master/Test%20Sequence/manually_import.py

If ever such an issue should arise again, please direct the contributor to
"Tests/test_testseq.py"
They can import the 'manually_import' function directly from there.

Than the issue arose that the 'run_tests.py' file could not import
'Scripts.testseq' prior to python 3.3. I decided to try using a permutation
of the 'manually_import' code to solve the problem and it worked! With one
caveat, the doctests within 'testseq.py' were subject to the same import
restrictions and copying the 'manually_import' code again within the
doctests seemed excessive. The solution that worked in the end was to
remove doctests from outside of the 'Bio' package in python versions prior
to 3.3.

Some of you have noted that I am very 'commited' to finishing my work on
this project. I've downloaded and am now running flake8 tests locally. I'm
looking into integrating flake8 directly into my IDE. I've also downloaded
virtualenv, and am looking into other solutions for local testing as well
(though it's not currently set up). The problem will definitely be
addressed before I begin work on reverting the seeding. Thank you for
helping. It means a lot.

Best,
Adil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython-dev/attachments/20170613/fc2231b8/attachment.html>


More information about the Biopython-dev mailing list