[med-svn] [python-pysam] 02/04: Fix some failing tests

Afif Elghraoui afif at moszumanska.debian.org
Thu Mar 10 07:50:21 UTC 2016


This is an automated email from the git hooks/post-receive script.

afif pushed a commit to branch master
in repository python-pysam.

commit 624c346a131ea1f07dddba8c1d175fd2ec66a9a4
Author: Afif Elghraoui <afif at ghraoui.name>
Date:   Wed Mar 9 23:35:17 2016 -0800

    Fix some failing tests
    
    These are mostly ones that require network access that are not
    properly handled.
---
 debian/patches/compile-test.patch                  | 15 ++++++
 .../patches/disable-tests-requiring-network.patch  | 61 ++++++++++++++++++++--
 debian/patches/series                              |  1 +
 3 files changed, 74 insertions(+), 3 deletions(-)

diff --git a/debian/patches/compile-test.patch b/debian/patches/compile-test.patch
new file mode 100644
index 0000000..d8f1ffc
--- /dev/null
+++ b/debian/patches/compile-test.patch
@@ -0,0 +1,15 @@
+Description: Fix compile-test
+Author: Afif Elghraoui <afif at debian.org>
+Forwarded: no
+Last-Update: 2016-03-09
+--- python-pysam.orig/tests/compile_test.py
++++ python-pysam/tests/compile_test.py
+@@ -15,7 +15,7 @@
+ 
+ 
+ import pyximport
+-pyximport.install(build_in_temp=False)
++pyximport.install(build_in_temp=True)
+ import _compile_test
+ 
+ import unittest
diff --git a/debian/patches/disable-tests-requiring-network.patch b/debian/patches/disable-tests-requiring-network.patch
index b6cf1a1..bc7872d 100644
--- a/debian/patches/disable-tests-requiring-network.patch
+++ b/debian/patches/disable-tests-requiring-network.patch
@@ -4,7 +4,7 @@ Forwarded: no
 Last-Update: 2015-11-13
 --- python-pysam.orig/tests/tabix_test.py
 +++ python-pysam/tests/tabix_test.py
-@@ -1124,7 +1124,8 @@
+@@ -1124,11 +1124,12 @@
      local = os.path.join(DATADIR, "example.gtf.gz")
  
      def setUp(self):
@@ -14,7 +14,12 @@ Last-Update: 2015-11-13
          self.local_file = pysam.TabixFile(self.local, "r")
  
      def testFetchAll(self):
-@@ -1139,11 +1140,12 @@
+-        if not checkURL(self.url):
++        if checkURL(self.url) == False:
+             return
+ 
+         remote_result = list(self.remote_file.fetch())
+@@ -1139,14 +1140,15 @@
              self.assertEqual(x, y)
  
      def testHeader(self):
@@ -31,4 +36,54 @@ Last-Update: 2015-11-13
 +                              "header")
  
      def tearDown(self):
-         self.remote_file.close()
+-        self.remote_file.close()
++#        self.remote_file.close()
+         self.local_file.close()
+ 
+ 
+--- python-pysam.orig/tests/AlignmentFile_test.py
++++ python-pysam/tests/AlignmentFile_test.py
+@@ -2466,12 +2466,16 @@
+             filepath_index=os.path.join(DATADIR, 'ex1.cram.crai'))
+ 
+     def testRemoteExplicitIndexBAM(self):
+-        samfile = pysam.AlignmentFile(
+-            "http://genserv.anat.ox.ac.uk/downloads/pysam/test/noindex.bam",
+-            "rb",
+-            filepath_index=os.path.join(DATADIR, 'ex1.bam.bai'))
++        url = "http://genserv.anat.ox.ac.uk/downloads/pysam/test/noindex.bam"
++        if checkURL(url):
++            samfile = pysam.AlignmentFile(
++                url,
++                "rb",
++                filepath_index=os.path.join(DATADIR, 'ex1.bam.bai'))
+ 
+-        samfile.fetch("chr1")
++            samfile.fetch("chr1")
++        else:
++            pass
+ 
+ 
+ class TestVerbosity(unittest.TestCase):
+--- python-pysam.orig/tests/faidx_test.py
++++ python-pysam/tests/faidx_test.py
+@@ -173,12 +173,13 @@
+ 
+ 
+     def testFTPView(self):
+-        if not checkURL(self.url):
+-            return
+-        f = pysam.Fastafile(self.url)
+-        self.assertEqual(
+-            len(f.fetch("chr1", 0, 1000)),
+-            1000)
++        if checkURL(self.url):
++            f = pysam.Fastafile(self.url)
++            self.assertEqual(
++                len(f.fetch("chr1", 0, 1000)),
++                1000)
++        else:
++            return True
+ 
+ 
+ if __name__ == "__main__":
diff --git a/debian/patches/series b/debian/patches/series
index 2e0c2ea..917fbdc 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 external-htslib.patch
 disable-tests-requiring-network.patch
 rpath.patch
+compile-test.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/python-pysam.git



More information about the debian-med-commit mailing list