Skip tests trying to access remote site
authorAndreas Tille <tille@debian.org>
Sun, 2 Oct 2022 09:41:36 +0000 (11:41 +0200)
committerÉtienne Mollier <emollier@debian.org>
Sun, 2 Oct 2022 09:41:36 +0000 (11:41 +0200)
Last-Update: Tue, 11 Sep 2018 14:12:55 +0200

Gbp-Pq: Name skip_test_remote.patch

tests/AlignmentFile_test.py
tests/tabix_test.py

index 3a6cafc88dd73cec6b8a5b448b7a2c3bb35992a6..01616923851219c52483fb03e5ae0bb963c0117f 100644 (file)
@@ -503,17 +503,6 @@ class TestIO(unittest.TestCase):
                        "tmp_ex2.sam",
                        "rb", "wh")
 
-    def testBAM2CRAM(self):
-        # ignore header (md5 sum)
-        self.checkEcho("ex2.bam",
-                       "ex2.cram",
-                       "tmp_ex2.cram",
-                       "rb", "wc",
-                       sequence_filename=os.path.join(BAM_DATADIR, "ex1.fa"),
-                       checkf=partial(
-                           check_samtools_view_equal,
-                           without_header=True))
-
     def testCRAM2BAM(self):
         # ignore header (md5 sum)
         self.checkEcho("ex2.cram",
@@ -1638,6 +1627,7 @@ class TestDoubleFetchCRAMWithReference(TestDoubleFetchBAM):
     reference_filename = os.path.join(BAM_DATADIR, 'ex1.fa')
 
 
+@unittest.skip
 class TestRemoteFileFTP(unittest.TestCase):
 
     '''test remote access.
index 3f1f716b7c2f8f5c691f1af33aaded2c73c12083..5452a527dbad3c5f722de55518e00cf6a2da1ee7 100644 (file)
@@ -1017,6 +1017,7 @@ for vcf_file in vcf_files:
     globals()[n] = type(n, (TestVCFFromVariantFile,), dict(filename=vcf_file,))
 
 
+@unittest.skip
 class TestRemoteFileHTTP(unittest.TestCase):
 
     url = "http://genserv.anat.ox.ac.uk/downloads/pysam/test/example.gtf.gz"
@@ -1056,25 +1057,28 @@ class TestRemoteFileHTTP(unittest.TestCase):
         self.assertEqual(list(self.local_file.header), [])
 
 
-class TestRemoteFileHTTPWithHeader(TestRemoteFileHTTP):
-
-    url = "http://genserv.anat.ox.ac.uk/downloads/pysam/test/example_comments.gtf.gz"
-    region = "chr1:1-1000"
-    local = os.path.join(TABIX_DATADIR, "example_comments.gtf.gz")
-
-    def setUp(self):
-        if not pysam.config.HAVE_LIBCURL or not check_url(self.url):
-            self.remote_file = None
-        else:
-            self.remote_file = pysam.TabixFile(self.url, "r")
-        self.local_file = pysam.TabixFile(self.local, "r")
-
-    def testHeader(self):
-        if self.remote_file is None:
-            return
-
-        self.assertEqual(list(self.local_file.header), ["# comment at start"])
-        self.assertEqual(list(self.local_file.header), self.remote_file.header)
+#@unittest.skip  #  this leads to
+                 #  E   TypeError: Error when calling the metaclass bases
+                 #  E       function() argument 1 must be code, not str
+#class TestRemoteFileHTTPWithHeader(TestRemoteFileHTTP):
+#
+#    url = "http://genserv.anat.ox.ac.uk/downloads/pysam/test/example_comments.gtf.gz"
+#    region = "chr1:1-1000"
+#    local = os.path.join(TABIX_DATADIR, "example_comments.gtf.gz")
+#
+#    def setUp(self):
+#        if not pysam.config.HAVE_LIBCURL or not check_url(self.url):
+#            self.remote_file = None
+#        else:
+#            self.remote_file = pysam.TabixFile(self.url, "r")
+#        self.local_file = pysam.TabixFile(self.local, "r")
+#
+#    def testHeader(self):
+#        if self.remote_file is None:
+#            return
+#
+#        self.assertEqual(list(self.local_file.header), ["# comment at start"])
+#        self.assertEqual(list(self.local_file.header), self.remote_file.header)
 
 
 class TestIndexArgument(unittest.TestCase):