Repository: jeffdaily/parasail-python (language: python)

Issue:
Running test suite in travis.
The test suite needs some work to get up and running again: rough plan -

- [X] Make Python 2 and 3 compatible *(remove use of print statements & pytest)*.
- [X] Use a test framework and test runner *(unittest in the stlib will do the job)*.
- [X] Skip the failing test initially.
- [X] Set `CIBW_TEST_COMMAND` to run the test suite against all the wheels on every commit.
- [ ] Fix the failing tests.
- [ ] Add more tests.


Discussion / hints:

Fix patch:
diff --git a/.travis.yml b/.travis.yml
index dce9af2..6e172a4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,7 +16,9 @@ jobs:
 
 env:
   global:
-    - CIBW_BUILD: cp37-*
+    - CIBW_BUILD="cp37-*"
+    - CIBW_TEST_COMMAND="python -m unittest discover {project}/tests"
+    - TWINE_USERNAME=__token__
 
 install:
   - python -m pip install twine cibuildwheel==1.1.0 wheel
@@ -27,4 +29,4 @@ script:
   - if [[ "$TRAVIS_OS_NAME" = "windows" ]];  then python setup.py sdist -d wheelhouse; fi
 
 after_success:
-  - if [[ $TRAVIS_TAG ]]; then python -m twine upload wheelhouse/*.whl; fi
+  - if [[ $TRAVIS_TAG ]]; then python -m twine upload wheelhouse/*; fi
diff --git a/README.rst b/README.rst
index 5282116..80a1a6e 100644
--- a/README.rst
+++ b/README.rst
@@ -21,6 +21,7 @@ Table of Contents
 -  `Installation <#installation>`__
 
    -  `Using pip <#using-pip>`__
+   -  `Testing <#tesing>`__
    -  `Building from Source <#building-from-source>`__
 
 -  `Quick Example <#quick-example>`__
@@ -58,6 +59,17 @@ The recommended way of installing is to use the latest version available via pip
     
 Binaries for Windows and OSX should be available via pip.  Using pip on a Linux platform will first download the latest version of the parasail C library sources and then compile them automatically into a shared library.  For an installation from sources, or to learn how the pip installation works on Linux, please read on.
 
+Testing
++++++++
+
+`back to top <#table-of-contents>`__
+
+To run the testsuite use the unittest runner.
+
+::
+
+    python -m unittest discover tests
+
 Building from Source
 ++++++++++++++++++++
 


Test patch:
diff --git a/tests/test_basic.py b/tests/test_basic.py
index fad5a92..b844700 100644
--- a/tests/test_basic.py
+++ b/tests/test_basic.py
@@ -1,38 +1,27 @@
-try:
-    import parasail
-except ImportError:
-    import sys, os
-    myPath = os.path.dirname(os.path.abspath(__file__))
-    sys.path.insert(0, myPath + '/../')
-    import parasail
-
-def test1():
-    result = parasail.sw("asdf","asdf",10,1,parasail.blosum62)
-    assert(result.score == 20)
-    del result
-
-def test2():
-    result = parasail.sw("asdf","asdf",10,1,parasail.pam50)
-    assert(result.score == 27)
-    del result
-
-def test3():
-    matrix = parasail.matrix_create("acgt", 1, -1)
-    result = parasail.sw("acgt","acgt",10,1,matrix)
-    assert(result.score == 4)
-    del result
-    del matrix
-
-def test4():
-    profile = parasail.profile_create_8("asdf", parasail.blosum62)
-    result = parasail.sw_striped_profile_8(profile,"asdf",10,1)
-    assert(result.score == 20)
-    del result
-    del profile
+import parasail
+from unittest import TestCase, main
+
+
+class Tests(TestCase):
+
+    def test1(self):
+        result = parasail.sw("asdf", "asdf", 10, 1, parasail.blosum62)
+        self.assertEqual(result.score, 20)
+
+    def test2(self):
+        result = parasail.sw("asdf", "asdf", 10, 1, parasail.pam50)
+        self.assertEqual(result.score, 27)
+
+    def test3(self):
+        matrix = parasail.matrix_create("acgt", 1, -1)
+        result = parasail.sw("acgt", "acgt", 10, 1, matrix)
+        self.assertEqual(result.score, 4)
+
+    def test4(self):
+        profile = parasail.profile_create_8("asdf", parasail.blosum62)
+        result = parasail.sw_striped_profile_8(profile, "asdf", 10, 1)
+        self.assertEqual(result.score, 20)
+
 
 if __name__ == '__main__':
-    print("running tests")
-    test1()
-    test2()
-    test3()
-    test4()
+    main()
diff --git a/tests/test_case.py b/tests/test_case.py
index 8254673..9d9ebdc 100644
--- a/tests/test_case.py
+++ b/tests/test_case.py
@@ -1,53 +1,47 @@
-try:
-    import parasail
-except ImportError:
-    import sys, os
-    myPath = os.path.dirname(os.path.abspath(__file__))
-    sys.path.insert(0, myPath + '/../')
-    import parasail
-
-def print_traceback_attributes(traceback):
-    print(traceback)
-    print(traceback.query)
-    print(traceback.comp)
-    print(traceback.ref)
-
-def test1():
-    matrix = parasail.matrix_create("ACGT", 2, 1)
-    result = parasail.sw_trace("ACGT","AcgT",10,1,matrix)
-    traceback = result.traceback
-    print_traceback_attributes(traceback)
-
-def test21():
-    matrix = parasail.matrix_create("ACGTacgt", 2, 1, True)
-    result = parasail.sw_trace("ACGT","AcgT",10,1,matrix)
-    traceback = result.traceback
-    print_traceback_attributes(traceback)
-
-def test22():
-    matrix = parasail.matrix_create("ACGTacgt", 2, 1, True)
-    result = parasail.sw_trace("ACGT","AcgT",10,1,matrix)
-    traceback = result.get_traceback(case_sensitive=True)
-    print_traceback_attributes(traceback)
-
-def test3():
-    parasail.set_case_sensitive(True)
-    matrix = parasail.matrix_create("ACGTacgt", 2, 1)
-    result = parasail.sw_trace("ACGT","AcgT",10,1,matrix)
-    traceback = result.traceback
-    print_traceback_attributes(traceback)
-
-def test4():
-    parasail.set_case_sensitive(True)
-    matrix = parasail.matrix_create("ACGT", 2, 1)
-    result = parasail.sw_trace("ACGT","AcgT",10,1,matrix)
-    traceback = result.traceback
-    print_traceback_attributes(traceback)
+import parasail
+from unittest import TestCase, main
+
+
+class Tests(TestCase):
+
+    def print_traceback_attributes(self, traceback):
+        print(traceback)
+        print(traceback.query)
+        print(traceback.comp)
+        print(traceback.ref)
+
+    def test1(self):
+        matrix = parasail.matrix_create("ACGT",  2,  1)
+        result = parasail.sw_trace("ACGT", "AcgT", 10, 1, matrix)
+        traceback = result.traceback
+        self.print_traceback_attributes(traceback)
+
+    def test21(self):
+        matrix = parasail.matrix_create("ACGTacgt",  2,  1,  True)
+        result = parasail.sw_trace("ACGT", "AcgT", 10, 1, matrix)
+        traceback = result.traceback
+        self.print_traceback_attributes(traceback)
+
+    def test22(self):
+        matrix = parasail.matrix_create("ACGTacgt",  2,  1,  True)
+        result = parasail.sw_trace("ACGT", "AcgT", 10, 1, matrix)
+        traceback = result.get_traceback(case_sensitive=True)
+        self.print_traceback_attributes(traceback)
+
+    def test3(self):
+        parasail.set_case_sensitive(True)
+        matrix = parasail.matrix_create("ACGTacgt",  2,  1)
+        result = parasail.sw_trace("ACGT", "AcgT", 10, 1, matrix)
+        traceback = result.traceback
+        self.print_traceback_attributes(traceback)
+
+    def test4(self):
+        parasail.set_case_sensitive(True)
+        matrix = parasail.matrix_create("ACGT",  2,  1)
+        result = parasail.sw_trace("ACGT", "AcgT", 10, 1, matrix)
+        traceback = result.traceback
+        self.print_traceback_attributes(traceback)
+
 
 if __name__ == '__main__':
-    print("running tests")
-    test1()
-    test21()
-    test22()
-    test3()
-    test4()
+    main()
diff --git a/tests/test_cigar.py b/tests/test_cigar.py
index 5a0585f..edf91c5 100644
--- a/tests/test_cigar.py
+++ b/tests/test_cigar.py
@@ -1,10 +1,6 @@
-try:
-    import parasail
-except ImportError:
-    import sys, os
-    myPath = os.path.dirname(os.path.abspath(__file__))
-    sys.path.insert(0, myPath + '/../')
-    import parasail
+import parasail
+from unittest import TestCase, main
+
 
 def print_cigar_attributes(cigar):
     print(cigar)
@@ -14,44 +10,34 @@ def print_cigar_attributes(cigar):
     print(cigar.beg_ref)
     print(cigar.decode)
 
+
 def print_traceback_attributes(traceback):
     print(traceback)
     print(traceback.query)
     print(traceback.comp)
     print(traceback.ref)
 
-def test0():
-    result = parasail.sw("asdf","asdf",10,1,parasail.blosum62)
-    try:
-        cigar = result.cigar
-        print_cigar_attributes(cigar)
-    except AttributeError:
-        pass
-    else:
-        raise Error("AttributeError expected, Failure")
-def test1():
-    result = parasail.sw("asdf","asdf",10,1,parasail.blosum62)
-    try:
-        traceback = result.traceback
-        print_traceback_attributes(traceback)
-    except AttributeError:
-        pass
-    else:
-        raise Error("AttributeError expected, Failure")
-
-def test2():
-    result = parasail.sw_trace("asdf","asdf",10,1,parasail.blosum62)
-    cigar = result.cigar
-    print_cigar_attributes(cigar)
-
-def test3():
-    result = parasail.sw_trace("asdf","asdf",10,1,parasail.blosum62)
-    traceback = result.traceback
-    print_traceback_attributes(traceback)
+
+class Tests(TestCase):
+
+    def test0(self):
+        result = parasail.sw("asdf", "asdf", 10, 1, parasail.blosum62)
+        with self.assertRaises(AttributeError):
+            print_cigar_attributes(result.cigar)
+
+    def test1(self):
+        result = parasail.sw("asdf", "asdf", 10, 1, parasail.blosum62)
+        with self.assertRaises(AttributeError):
+            print_traceback_attributes(result.traceback)
+
+    def test2(self):
+        result = parasail.sw_trace("asdf", "asdf", 10, 1, parasail.blosum62)
+        print_cigar_attributes(result.cigar)
+
+    def test3(self):
+        result = parasail.sw_trace("asdf", "asdf", 10, 1, parasail.blosum62)
+        print_traceback_attributes(result.traceback)
+
 
 if __name__ == '__main__':
-    print("running tests")
-    test0()
-    test1()
-    test2()
-    test3()
+    main()
diff --git a/tests/test_io.py b/tests/test_io.py
index 00e56b7..8c62455 100644
--- a/tests/test_io.py
+++ b/tests/test_io.py
@@ -1,12 +1,8 @@
-import pytest
+import os
+import parasail
+from unittest import TestCase, main
+from tempfile import NamedTemporaryFile
 
-try:
-    import parasail
-except ImportError:
-    import sys, os
-    myPath = os.path.dirname(os.path.abspath(__file__))
-    sys.path.insert(0, myPath + '/../')
-    import parasail
 
 def create_input_file(filename):
     with open(filename, 'w') as fp:
@@ -16,46 +12,51 @@ def create_input_file(filename):
 GNYEFVKVEKEGKVGVLKLNRPRRANALNPTFLKEVEDALDLLERDEEVRAIVIAGEGKNFCAGADIAMFASGRPEMVTEFSQLGHKVFRKIEMLSKPVIAAIHGAAVGGGFELAMACDLRVMSERAFLGLPELNLGIIPGWGGTQRLAYYVGVSKLKEVIMLKRNIKPEEAKNLGLVAEVFPQERFWDEVMKLAREVAELPPLAVKYLKKVIALGTMPALETGNLAESEAGAVIALTDDVAEGIQAFNYRRKPNFRGR
 ''')
 
-def work(filename):
-    sequences = parasail.sequences_from_file(filename)
-    print(len(sequences))
-    print(len(sequences[0]))
-    print(sequences[0])
-    print(len(sequences[-1]))
-    print(sequences[-1])
-    print(sequences[0][0])
-    with pytest.raises(TypeError):
-        print(sequences['asdf'])
-    with pytest.raises(TypeError):
-        print(sequences[0]['asdf'])
-    with pytest.raises(IndexError):
-        print(sequences[1000000])
-    with pytest.raises(IndexError):
-        print(sequences[-1000000])
-    with pytest.raises(IndexError):
-        print(sequences[0][1000000])
-    with pytest.raises(IndexError):
-        print(sequences[0][-1000000])
-    print("name:    '{}'".format(sequences[0].name))
-    print("comment: '{}'".format(sequences[0].comment))
-    print("seq:     '{}'".format(sequences[0].seq))
-    print("qual:    '{}'".format(sequences[0].qual))
-    print("characters: {}".format(sequences.characters))
-    print("shortest:   {}".format(sequences.shortest))
-    print("longest:    {}".format(sequences.longest))
-    print("mean:       {}".format(sequences.mean))
-    print("stddev:     {}".format(sequences.stddev))
-    result = parasail.sw(str(sequences[0]), str(sequences[1]), 10, 1, parasail.blosum62)
-    print(result.score)
-    result = parasail.sw(sequences[0], sequences[1], 10, 1, parasail.blosum62)
-    print(result.score)
-
-def test1(tmpdir):
-    filename = 'input.txt'
-    file = tmpdir.join(filename)
-    create_input_file(file.strpath)
-    work(file.strpath)
+
+class Tests(TestCase):
+
+    def setUp(self):
+        self.tmpfile = NamedTemporaryFile()
+        create_input_file(self.tmpfile.name)
+
+    def tearDown(self):
+        os.unlink(self.tmpfile.name)
+        os.path.exists(self.tempfile.name)
+
+    def work(self):
+        sequences = parasail.sequences_from_file(self.tmpfile)
+        print(len(sequences))
+        print(len(sequences[0]))
+        print(sequences[0])
+        print(len(sequences[-1]))
+        print(sequences[-1])
+        print(sequences[0][0])
+        with self.assertRaises(TypeError):
+            print(sequences['asdf'])
+        with self.assertRaises(TypeError):
+            print(sequences[0]['asdf'])
+        with self.assertRaises(IndexError):
+            print(sequences[1000000])
+        with self.assertRaises(IndexError):
+            print(sequences[-1000000])
+        with self.assertRaises(IndexError):
+            print(sequences[0][1000000])
+        with self.assertRaises(IndexError):
+            print(sequences[0][-1000000])
+        print("name:    '{}'".format(sequences[0].name))
+        print("comment: '{}'".format(sequences[0].comment))
+        print("seq:     '{}'".format(sequences[0].seq))
+        print("qual:    '{}'".format(sequences[0].qual))
+        print("characters: {}".format(sequences.characters))
+        print("shortest:   {}".format(sequences.shortest))
+        print("longest:    {}".format(sequences.longest))
+        print("mean:       {}".format(sequences.mean))
+        print("stddev:     {}".format(sequences.stddev))
+        result = parasail.sw(str(sequences[0]), str(sequences[1]), 10, 1, parasail.blosum62)
+        print(result.score)
+        result = parasail.sw(sequences[0], sequences[1], 10, 1, parasail.blosum62)
+        print(result.score)
+
 
 if __name__ == '__main__':
-    import sys
-    work(sys.argv[1])
+    main()
diff --git a/tests/test_matrix.py b/tests/test_matrix.py
index 1bdf688..85b9115 100644
--- a/tests/test_matrix.py
+++ b/tests/test_matrix.py
@@ -1,34 +1,32 @@
-try:
-    import parasail
-except ImportError:
-    import sys, os
-    myPath = os.path.dirname(os.path.abspath(__file__))
-    sys.path.insert(0, myPath + '/../')
-    import parasail
-
-def test1():
-    matrix = parasail.blosum62
-    matrix[3,4] = 100
-    print(matrix.matrix)
-
-    matrix = parasail.blosum62.copy()
-    matrix[3,4] = 100
-    print(matrix.matrix)
-
-    matrix = parasail.matrix_create("ACGT", 10, 1)
-    matrix[2] = 200
-    matrix[1:3, 1:3] = 300
-    matrix.set_value(0,4,400)
-    print(matrix.matrix)
-
-    matrix = parasail.matrix_create("AcgT", 10, 1)
-    print(matrix.matrix)
-    print(matrix.mapper)
-
-    matrix = parasail.matrix_create("AcgT", 10, 1, True)
-    print(matrix.matrix)
-    print(matrix.mapper)
+import parasail
+from unittest import TestCase, main
+
+
+class Tests(TestCase):
+
+    def test1(self):
+        matrix = parasail.blosum62
+        matrix[3, 4] = 100
+        print(matrix.matrix)
+
+        matrix = parasail.blosum62.copy()
+        matrix[3, 4] = 100
+        print(matrix.matrix)
+
+        matrix = parasail.matrix_create("ACGT", 10, 1)
+        matrix[2] = 200
+        matrix[1:3,  1:3] = 300
+        matrix.set_value(0, 4, 400)
+        print(matrix.matrix)
+
+        matrix = parasail.matrix_create("AcgT", 10, 1)
+        print(matrix.matrix)
+        print(matrix.mapper)
+
+        matrix = parasail.matrix_create("AcgT", 10, 1, True)
+        print(matrix.matrix)
+        print(matrix.mapper)
+
 
 if __name__ == '__main__':
-    print("running tests")
-    test1()
+    main()
diff --git a/tests/test_ssw.py b/tests/test_ssw.py
index a282c73..38b2613 100644
--- a/tests/test_ssw.py
+++ b/tests/test_ssw.py
@@ -1,35 +1,35 @@
-try:
-    import parasail
-except ImportError:
-    import sys, os
-    myPath = os.path.dirname(os.path.abspath(__file__))
-    sys.path.insert(0, myPath + '/../')
-    import parasail
-
-def test1():
-    p = parasail.ssw_init("asdf", parasail.blosum62, 1)
-    r = parasail.ssw_profile(p, "asdf", 10, 1)
-
-    print(p.s1)
-    print(p.s1Len)
-    print(r.cigarLen)
-    print(r.cigar[0])
-
-    r = parasail.sw_trace("asdf", "asdf", 10, 1, parasail.blosum62)
-    c = r.cigar
-    print(c.len)
-    print(c.seq[0])
-    print(c.decode)
-
-    p = parasail.profile_create_8("asdf", parasail.blosum62)
-    r = parasail.sw_trace_striped_profile_8(p, "asdf", 10, 1)
-    c = r.cigar
-    print(c.len)
-    print(c.seq[0])
-
-    r = parasail.sw_trace("asdf", "asdf", 10, 1, parasail.blosum62)
-    print(r.query)
-    print(r.ref)
+import parasail
+from unittest import TestCase, main, expectedFailure
+
+
+class Tests(TestCase):
+
+    @expectedFailure
+    def test1(self):
+        p = parasail.ssw_init("asdf", parasail.blosum62, 1)
+        r = parasail.ssw_profile(p, "asdf", 10, 1)
+
+        print(p.s1)
+        print(p.s1Len)
+        print(r.cigarLen)
+        print(r.cigar[0])
+
+        r = parasail.sw_trace("asdf", "asdf", 10, 1, parasail.blosum62)
+        c = r.cigar
+        print(c.len)
+        print(c.seq[0])
+        print(c.decode)
+
+        p = parasail.profile_create_8("asdf", parasail.blosum62)
+        r = parasail.sw_trace_striped_profile_8(p, "asdf", 10, 1)
+        c = r.cigar
+        print(c.len)
+        print(c.seq[0])
+
+        r = parasail.sw_trace("asdf", "asdf", 10, 1, parasail.blosum62)
+        print(r.query)
+        print(r.ref)
+
 
 if __name__ == '__main__':
-    test1()
+    main()
diff --git a/tests/test_tables.py b/tests/test_tables.py
index c954e43..abcbe54 100644
--- a/tests/test_tables.py
+++ b/tests/test_tables.py
@@ -1,147 +1,144 @@
-import pytest
-
-try:
-    import parasail
-except ImportError:
-    import sys, os
-    myPath = os.path.dirname(os.path.abspath(__file__))
-    sys.path.insert(0, myPath + '/../')
-    import parasail
-
-def test():
-    result = parasail.sw_table("asdf","asdfasdf",10,1,parasail.blosum62)
-    print result
-    print result.saturated
-    print result.score
-    with pytest.raises(AttributeError):
-        print result.matches
-    with pytest.raises(AttributeError):
-        print result.similar
-    with pytest.raises(AttributeError):
-        print result.length
-    print result.score_table
-
-    result = parasail.sw_stats_table("asdf","asdfasdf",10,1,parasail.blosum62)
-    print result
-    print result.saturated
-    print result.score
-    print result.matches
-    print result.similar
-    print result.length
-    print result.score_table
-    print result.matches_table
-    print result.similar_table
-    print result.length_table
-
-    result = parasail.sw_rowcol("asdf","asdfasdf",10,1,parasail.blosum62)
-    print result
-    print result.saturated
-    print result.score
-    with pytest.raises(AttributeError):
-        print result.matches
-    with pytest.raises(AttributeError):
-        print result.similar
-    with pytest.raises(AttributeError):
-        print result.length
-    print result.score_row
-    print result.score_col
-
-    result = parasail.sw_stats_rowcol("asdf","asdfasdf",10,1,parasail.blosum62)
-    print result
-    print result.saturated
-    print result.score
-    print result.matches
-    print result.similar
-    print result.length
-    print result.score_row
-    print result.score_col
-    print result.matches_row
-    print result.matches_col
-    print result.similar_row
-    print result.similar_col
-    print result.length_row
-    print result.length_col
-
-    result = parasail.sw("asdf","asdf",10,1,parasail.blosum62)
-    print result
-    print result.saturated
-    print result.score
-    with pytest.raises(AttributeError):
-        print result.matches
-    with pytest.raises(AttributeError):
-        print result.similar
-    with pytest.raises(AttributeError):
-        print result.length
-    with pytest.raises(AttributeError):
-        print result.score_table
-
-    result = parasail.sw_stats("asdf","asdf",10,1,parasail.blosum62)
-    print result
-    print result.saturated
-    print result.score
-    print result.matches
-    print result.similar
-    print result.length
-
-    result = parasail.sw_scan_32("asdf","asdf",10,1,parasail.blosum62)
-    print result
-    print result.saturated
-    print result.score
-    with pytest.raises(AttributeError):
-        print result.matches
-    with pytest.raises(AttributeError):
-        print result.similar
-    with pytest.raises(AttributeError):
-        print result.length
-
-    result = parasail.sw_scan_16("asdf","asdf",10,1,parasail.blosum62)
-    print result
-    print result.saturated
-    print result.score
-    with pytest.raises(AttributeError):
-        print result.matches
-    with pytest.raises(AttributeError):
-        print result.similar
-    with pytest.raises(AttributeError):
-        print result.length
-
-    result = parasail.sw_stats_striped_16("asdf","asdf",10,1,parasail.blosum62)
-    print result
-    print result.saturated
-    print result.score
-    print result.matches
-    print result.similar
-    print result.length
-
-    print parasail.blosum62.name
-    print parasail.blosum62.size
-    print parasail.blosum62.matrix
-
-    profile = parasail.profile_create_8("asdf", parasail.blosum62)
-    profile = parasail.profile_create_8("asdf", parasail.blosum62)
-    print profile
-    print profile.s1
-    print profile.matrix
-
-    result = parasail.sw_striped_profile_8(profile,"asdf",10,1)
-    print result
-    print result.saturated
-    print result.score
-
-    profile = parasail.profile_create_sat("asdf", parasail.blosum62)
-    print profile
-    print profile.s1
-    print profile.matrix
-    print dir(profile.matrix)
-    print profile.matrix.min
-    print profile.matrix.max
-    print profile.matrix.size
-
-    result = parasail.sw_striped_profile_sat(profile,"asdf",10,1)
-    print result
-    print result.saturated
-    print result.score
-    print type(result.score)
+import parasail
+from unittest import TestCase,  main
+
+
+class Tests(TestCase):
+
+    def test(self):
+        result = parasail.sw_table("asdf", "asdfasdf", 10, 1, parasail.blosum62)
+        print(result)
+        print(result.saturated)
+        print(result.score)
+        with self.assertRaises(AttributeError):
+            print(result.matches)
+        with self.assertRaises(AttributeError):
+            print(result.similar)
+        with self.assertRaises(AttributeError):
+            print(result.length)
+        print(result.score_table)
+
+        result = parasail.sw_stats_table("asdf", "asdfasdf", 10, 1, parasail.blosum62)
+        print(result)
+        print(result.saturated)
+        print(result.score)
+        print(result.matches)
+        print(result.similar)
+        print(result.length)
+        print(result.score_table)
+        print(result.matches_table)
+        print(result.similar_table)
+        print(result.length_table)
+
+        result = parasail.sw_rowcol("asdf", "asdfasdf", 10, 1, parasail.blosum62)
+        print(result)
+        print(result.saturated)
+        print(result.score)
+        with self.assertRaises(AttributeError):
+            print(result.matches)
+        with self.assertRaises(AttributeError):
+            print(result.similar)
+        with self.assertRaises(AttributeError):
+            print(result.length)
+        print(result.score_row)
+        print(result.score_col)
+
+        result = parasail.sw_stats_rowcol("asdf", "asdfasdf", 10, 1, parasail.blosum62)
+        print(result)
+        print(result.saturated)
+        print(result.score)
+        print(result.matches)
+        print(result.similar)
+        print(result.length)
+        print(result.score_row)
+        print(result.score_col)
+        print(result.matches_row)
+        print(result.matches_col)
+        print(result.similar_row)
+        print(result.similar_col)
+        print(result.length_row)
+        print(result.length_col)
+
+        result = parasail.sw("asdf", "asdf", 10, 1, parasail.blosum62)
+        print(result)
+        print(result.saturated)
+        print(result.score)
+        with self.assertRaises(AttributeError):
+            print(result.matches)
+        with self.assertRaises(AttributeError):
+            print(result.similar)
+        with self.assertRaises(AttributeError):
+            print(result.length)
+        with self.assertRaises(AttributeError):
+            print(result.score_table)
+
+        result = parasail.sw_stats("asdf", "asdf", 10, 1, parasail.blosum62)
+        print(result)
+        print(result.saturated)
+        print(result.score)
+        print(result.matches)
+        print(result.similar)
+        print(result.length)
+
+        result = parasail.sw_scan_32("asdf", "asdf", 10, 1, parasail.blosum62)
+        print(result)
+        print(result.saturated)
+        print(result.score)
+        with self.assertRaises(AttributeError):
+            print(result.matches)
+        with self.assertRaises(AttributeError):
+            print(result.similar)
+        with self.assertRaises(AttributeError):
+            print(result.length)
+
+        result = parasail.sw_scan_16("asdf", "asdf", 10, 1, parasail.blosum62)
+        print(result)
+        print(result.saturated)
+        print(result.score)
+        with self.assertRaises(AttributeError):
+            print(result.matches)
+        with self.assertRaises(AttributeError):
+            print(result.similar)
+        with self.assertRaises(AttributeError):
+            print(result.length)
+
+        result = parasail.sw_stats_striped_16("asdf", "asdf", 10, 1, parasail.blosum62)
+        print(result)
+        print(result.saturated)
+        print(result.score)
+        print(result.matches)
+        print(result.similar)
+        print(result.length)
+
+        print(parasail.blosum62.name)
+        print(parasail.blosum62.size)
+        print(parasail.blosum62.matrix)
+
+        profile = parasail.profile_create_8("asdf",  parasail.blosum62)
+        profile = parasail.profile_create_8("asdf",  parasail.blosum62)
+        print(profile)
+        print(profile.s1)
+        print(profile.matrix)
+
+        result = parasail.sw_striped_profile_8(profile, "asdf", 10, 1)
+        print(result)
+        print(result.saturated)
+        print(result.score)
+
+        profile = parasail.profile_create_sat("asdf",  parasail.blosum62)
+        print(profile)
+        print(profile.s1)
+        print(profile.matrix)
+        print(dir(profile.matrix))
+        print(profile.matrix.min)
+        print(profile.matrix.max)
+        print(profile.matrix.size)
+
+        result = parasail.sw_striped_profile_sat(profile, "asdf", 10, 1)
+        print(result)
+        print(result.saturated)
+        print(result.score)
+        print(type(result.score))
+
 
 if __name__ == '__main__':
-    test()
+    main()