File: test_pairwise2_no_C.py

package info (click to toggle)
python-biopython 1.85%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 126,372 kB
  • sloc: xml: 1,047,995; python: 332,722; ansic: 16,944; sql: 1,208; makefile: 140; sh: 81
file content (32 lines) | stat: -rw-r--r-- 1,150 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# This code is part of the Biopython distribution and governed by its
# license.  Please see the LICENSE file that should have been included
# as part of this package.

"""Tests for pairwise2 module using the pure Python fallback functions.

This test file imports the TestCases from ``pairwise2_testCases.py``.
If you want to add more tests, do this over there.

"""

import unittest

# Import all test classes deliberately:
from pairwise2_testCases import *  # noqa: F401, F403

from Bio import pairwise2

if __name__ == "__main__":
    runner = unittest.TextTestRunner(verbosity=2)
    # Explicitly using pure Python fallback functions:
    orig_make_score_matrix_fast = pairwise2._make_score_matrix_fast
    orig_rint = pairwise2.rint
    try:
        pairwise2._make_score_matrix_fast = pairwise2._python_make_score_matrix_fast
        pairwise2.rint = pairwise2._python_rint
        unittest.main(testRunner=runner)
    finally:
        # To avoid interfering with the remaining pairwise2 tests,
        # restore the original functions
        pairwise2._make_score_matrix_fast = orig_make_score_matrix_fast
        pairwise2.rint = orig_rint