[med-svn] [Git][med-team/python-deeptools][master] 4 commits: d/{, t/}control: depend on pytest instead of nose.

Étienne Mollier (@emollier) gitlab at salsa.debian.org
Fri Dec 2 15:19:16 GMT 2022



Étienne Mollier pushed to branch master at Debian Med / python-deeptools


Commits:
a4d75fae by Étienne Mollier at 2022-12-02T15:57:57+01:00
d/{,t/}control: depend on pytest instead of nose.

Closes: #1018477

- - - - -
592fb438 by Étienne Mollier at 2022-12-02T15:59:18+01:00
d/{rules,t/run-unit-test}: use pytest-3 instead of nosetests3.

- - - - -
73130b3d by Étienne Mollier at 2022-12-02T16:17:58+01:00
pytest.patch: add; convert tests to pytest usage.

- - - - -
d0a6e6ea by Étienne Mollier at 2022-12-02T16:18:37+01:00
update changelog.

- - - - -


7 changed files:

- debian/changelog
- debian/control
- + debian/patches/pytest.patch
- debian/patches/series
- debian/rules
- debian/tests/control
- debian/tests/run-unit-test


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+python-deeptools (3.5.1-2) UNRELEASED; urgency=medium
+
+  * d/{,t/}control: depend on pytest instead of nose. (Closes: #1018477)
+  * d/{rules,t/run-unit-test}: use pytest-3 instead of nosetests3.
+  * pytest.patch: add; convert tests to pytest usage.
+
+ -- Étienne Mollier <emollier at debian.org>  Fri, 02 Dec 2022 16:18:12 +0100
+
 python-deeptools (3.5.1-1) unstable; urgency=medium
 
   * Team Upload.


=====================================
debian/control
=====================================
@@ -16,7 +16,7 @@ Build-Depends: debhelper-compat (= 13),
                python3-pybigwig,
                python3-plotly (>=4.9.0),
                python3-deeptoolsintervals,
-               python3-nose <!nocheck>
+               python3-pytest <!nocheck>
 Standards-Version: 4.5.1
 Vcs-Browser: https://salsa.debian.org/med-team/python-deeptools
 Vcs-Git: https://salsa.debian.org/med-team/python-deeptools.git


=====================================
debian/patches/pytest.patch
=====================================
@@ -0,0 +1,343 @@
+Description: convert test scripts to pytest.
+Author: Étienne Mollier <emollier at debian.org>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1018477
+Forwarded: no
+Last-Update: 2022-12-02
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- python-deeptools.orig/deeptools/test/test_bamCoverage_and_bamCompare.py
++++ python-deeptools/deeptools/test/test_bamCoverage_and_bamCompare.py
+@@ -1,4 +1,3 @@
+-from nose.tools import assert_equal
+ import deeptools.bamCoverage as bam_cov
+ import deeptools.bamCompare as bam_comp
+ import deeptools.getScaleFactor as gs
+@@ -46,7 +45,7 @@
+         resp = _foo.readlines()
+         _foo.close()
+         expected = ['3R\t0\t50\t0\n', '3R\t50\t150\t1\n', '3R\t150\t200\t2\n']
+-        assert_equal(resp, expected)
++        assert resp == expected
+         unlink(outfile)
+ 
+ 
+@@ -59,7 +58,7 @@
+         resp = _foo.readlines()
+         _foo.close()
+         expected = ['3R\t0\t150\t1\n', '3R\t150\t200\t3\n']
+-        assert_equal(resp, expected)
++        assert resp == expected
+         unlink(outfile)
+ 
+ 
+@@ -76,7 +75,7 @@
+         # the scale factor should be 0.5, thus the result is similar to
+         # that of the previous test divided by 0.5
+         expected = ['3R\t0\t150\t0.5\n', '3R\t150\t200\t1.5\n']
+-        assert_equal(resp, expected)
++        assert resp == expected
+         unlink(outfile)
+ 
+ 
+@@ -90,7 +89,7 @@
+         resp = _foo.readlines()
+         _foo.close()
+         expected = ['3R\t50\t150\t1\n', '3R\t150\t200\t2\n']
+-        assert_equal(resp, expected)
++        assert resp == expected
+         unlink(outfile)
+ 
+ 
+@@ -104,7 +103,7 @@
+         resp = _foo.readlines()
+         _foo.close()
+         expected = ['3R\t0\t50\t0\n', '3R\t50\t200\t1\n']
+-        assert_equal(resp, expected)
++        assert resp == expected
+         unlink(outfile)
+ 
+ 
+@@ -124,7 +123,7 @@
+         resp = _foo.readlines()
+         _foo.close()
+         expected = ['3R\t0\t200\t1\n']
+-        assert_equal(resp, expected)
++        assert resp == expected
+         unlink(outfile)
+ 
+ 
+@@ -142,7 +141,7 @@
+         resp = _foo.readlines()
+         _foo.close()
+         expected = ['3R\t0\t50\t0\n', '3R\t50\t100\t-1\n', '3R\t100\t150\t0\n', '3R\t150\t200\t-1\n']
+-        assert_equal(resp, expected)
++        assert resp == expected
+         unlink(outfile)
+ 
+ 
+@@ -159,7 +158,7 @@
+     resp = _foo.readlines()
+     _foo.close()
+     expected = ['3R\t0\t50\tinf\n', '3R\t50\t100\t0\n', '3R\t100\t150\t1\n', '3R\t150\t200\t0\n']
+-    assert_equal(resp, expected)
++    assert resp == expected
+     unlink(outfile)
+ 
+ 
+@@ -176,7 +175,7 @@
+     resp = _foo.readlines()
+     _foo.close()
+     expected = ['3R\t50\t100\t-1\n', '3R\t100\t150\t0\n', '3R\t150\t200\t-0.584963\n']
+-    assert_equal(resp, expected)
++    assert resp == expected
+     unlink(outfile)
+ 
+ 
+@@ -228,7 +227,7 @@
+         resp = _foo.readlines()
+         _foo.close()
+         expected = ['3R\t100\t150\t0\n', '3R\t150\t200\t-1\n']
+-        assert_equal(resp, expected)
++        assert resp == expected
+         unlink(outfile)
+ 
+ 
+@@ -246,7 +245,7 @@
+         resp = _foo.readlines()
+         _foo.close()
+         expected = ['3R\t0\t100\t-1\n', '3R\t100\t150\t1\n', '3R\t150\t200\t-1\n']
+-        assert_equal(resp, expected)
++        assert resp == expected
+         unlink(outfile)
+ 
+ 
+@@ -286,7 +285,7 @@
+         """
+ 
+         expected = ['3R\t0\t50\t1\n', '3R\t50\t100\t0.666667\n', '3R\t100\t150\t1.33333\n', '3R\t150\t200\t1\n']
+-        assert_equal(resp, expected)
++        assert resp == expected
+         unlink(outfile)
+ 
+ 
+@@ -328,7 +327,7 @@
+         """
+ 
+         expected = ['3R\t0\t50\t0\n', '3R\t50\t100\t-250000\n', '3R\t100\t150\t250000\n', '3R\t150\t200\t0\n']
+-        assert_equal(resp, expected)
++        assert resp == expected
+         unlink(outfile)
+ 
+ 
+@@ -358,7 +357,7 @@
+                     '3R\t950\t1000\t1.62672\n', '3R\t1000\t1050\t0.813362\n',
+                     '3R\t1050\t1500\t0\n']
+ 
+-        assert_equal(resp, expected)
++        assert resp == expected
+         unlink(outfile)
+ 
+ 
+@@ -459,5 +458,5 @@
+                     '3R\t750\t800\t-0.123451\n', '3R\t900\t950\t0.212545\n',
+                     '3R\t950\t1000\t0.199309\n', '3R\t1000\t1050\t0.167945\n',
+                     '3R\t1050\t1500\t0\n']
+-        assert_equal(resp, expected)
++        assert resp == expected
+         unlink(outfile)
+--- python-deeptools.orig/deeptools/test/test_writeBedGraph.py
++++ python-deeptools/deeptools/test/test_writeBedGraph.py
+@@ -1,5 +1,4 @@
+ from unittest import TestCase
+-from nose.tools import *
+ import os
+ 
+ import deeptools.writeBedGraph as wr
+@@ -11,8 +10,7 @@
+ 
+ 
+ class TestWriteBedGraph(TestCase):
+-
+-    def setUp(self):
++    def setup(self):
+         """
+         The distribution of reads between the two bam files is as follows.
+ 
+@@ -44,6 +42,7 @@
+                                   stepSize=self.step_size)
+ 
+     def test_writeBedGraph_worker(self):
++        self.setup()
+         self.c.zerosToNans = False
+         self.c.skipZeros = False
+ 
+@@ -51,29 +50,32 @@
+         _foo = open(tempFile[3], 'r')
+         res = _foo.readlines()
+         _foo.close()
+-        assert_equal(res, ['3R\t0\t100\t0\n', '3R\t100\t200\t1\n'])
++        assert res == ['3R\t0\t100\t0\n', '3R\t100\t200\t1\n']
+         os.remove(tempFile[3])
+ 
+     def test_writeBedGraph_worker_zerotonan(self):
++        self.setup()
+         # turn on zeroToNan
+         self.c.zerosToNans = True
+         tempFile2 = self.c.writeBedGraph_worker('3R', 0, 200, scaleCoverage, self.func_args)
+         _foo = open(tempFile2[3], 'r')
+         res = _foo.readlines()
+         _foo.close()
+-        assert_equal(res, ['3R\t100\t200\t1\n'])
++        assert res == ['3R\t100\t200\t1\n']
+         os.remove(tempFile2[3])
+ 
+     def test_writeBedGraph_worker_scaling(self):
++        self.setup()
+         func_args = {'scaleFactor': 3.0}
+         tempFile = self.c.writeBedGraph_worker('3R', 0, 200, scaleCoverage, func_args)
+         _foo = open(tempFile[3], 'r')
+         res = _foo.readlines()
+         _foo.close()
+-        assert_equal(res, ['3R\t0\t100\t0\n', '3R\t100\t200\t3\n'])
++        assert res == ['3R\t0\t100\t0\n', '3R\t100\t200\t3\n']
+         os.remove(tempFile[3])
+ 
+     def test_writeBedGraph_worker_ignore_duplicates(self):
++        self.setup()
+         self.c = wr.WriteBedGraph([self.bamFile2],
+                                   binLength=self.bin_length,
+                                   stepSize=self.step_size, ignoreDuplicates=True)
+@@ -83,10 +85,11 @@
+         _foo = open(tempFile[3], 'r')
+         res = _foo.readlines()
+         _foo.close()
+-        assert_equal(res, ['3R\t50\t200\t1\n'])
++        assert res == ['3R\t50\t200\t1\n']
+         os.remove(tempFile[3])
+ 
+     def test_writeBedGraph_worker_smoothing(self):
++        self.setup()
+         self.c.binLength = 20
+         self.c.stepSize = 20
+         self.c.smoothLength = 60
+@@ -94,7 +97,7 @@
+         _foo = open(tempFile[3], 'r')
+         res = _foo.readlines()
+         _foo.close()
+-        assert_equal(res, ['3R\t100\t120\t1\n', '3R\t120\t180\t1.33333\n', '3R\t180\t200\t1\n'])
++        assert res == ['3R\t100\t120\t1\n', '3R\t120\t180\t1.33333\n', '3R\t180\t200\t1\n']
+         os.remove(tempFile[3])
+ 
+     def test_writeBedGraph_cigar(self):
+@@ -104,6 +107,7 @@
+         that maps to a chromosome named chr_cigar.
+         """
+ 
++        self.setup()
+         # turn of read extension
+         self.c.extendPairedEnds = False
+         self.c.binLength = 10
+@@ -114,16 +118,16 @@
+         _foo.close()
+ 
+         # the sigle read is split into bin 10-30, and then 40-50
+-        assert_equal(res, ['chr_cigar\t0\t10\t0\n',
+-                           'chr_cigar\t10\t30\t1\n',
+-                           'chr_cigar\t30\t40\t0\n',
+-                           'chr_cigar\t40\t50\t1\n',
+-                           'chr_cigar\t50\t100\t0\n'])
++        assert res == ['chr_cigar\t0\t10\t0\n',
++                       'chr_cigar\t10\t30\t1\n',
++                       'chr_cigar\t30\t40\t0\n',
++                       'chr_cigar\t40\t50\t1\n',
++                       'chr_cigar\t50\t100\t0\n']
+         os.remove(tempFile[3])
+ 
+ 
+ class TestWriteBedGraphCRAM(TestWriteBedGraph):
+-    def setUp(self):
++    def setup(self):
+         """
+         As above, but for CRAM files
+         """
+--- python-deeptools.orig/deeptools/test/test_readFiltering.py
++++ python-deeptools/deeptools/test/test_readFiltering.py
+@@ -1,4 +1,3 @@
+-from nose.tools import assert_equal
+ import deeptools.estimateReadFiltering as est
+ import deeptools.alignmentSieve as sieve
+ import os.path
+@@ -31,7 +30,7 @@
+     _ = resp[1].split("\t")
+     _[0] = os.path.basename(_[0])
+     resp[1] = "\t".join(_)
+-    assert_equal(resp, expected)
++    assert resp == expected
+     unlink(outfile)
+ 
+ 
+@@ -52,7 +51,7 @@
+     resp[1] = "\t".join(_)
+     expected = ['Sample\tTotal Reads\tMapped Reads\tAlignments in blacklisted regions\tEstimated mapped reads filtered\tBelow MAPQ\tMissing Flags\tExcluded Flags\tInternally-determined Duplicates\tMarked Duplicates\tSingletons\tWrong strand\n',
+                 'test_filtering.bam\t193\t193\t7\t193\t41.4\t0.0\t186.5\t31.6\t0.0\t0.0\t0.0\n']
+-    assert_equal(resp, expected)
++    assert resp == expected
+     unlink(outfile)
+ 
+ @unittest.skip(reason='Skip this test (see )https://github.com/deeptools/deepTools/issues/903')
+@@ -73,7 +72,7 @@
+     expected = ['#bamFilterReads --filterMetrics\n',
+                 '#File\tReads Remaining\tTotal Initial Reads\n',
+                 'test_filtering\t5\t193\n']
+-    assert_equal(resp, expected)
++    assert resp == expected
+     unlink(outlog)
+     h = hashlib.md5(pysam.view(outfile).encode('utf-8')).hexdigest()
+     assert(h == "acbc4443fb0387bfd6c412af9d4fc414")
+@@ -122,7 +121,7 @@
+                 'chr2\t5001491\t5001527\n',
+                 'chr2\t5001700\t5001736\n']
+ 
+-    assert_equal(resp, expected)
++    assert resp == expected
+     unlink(outfile)
+ 
+ 
+@@ -162,5 +161,5 @@
+                 'chr2\t5001119\t5001266\n',
+                 'chr2\t5001230\t5001600\n']
+ 
+-    assert_equal(resp, expected)
++    assert resp == expected
+     unlink(outfile)
+--- python-deeptools.orig/deeptools/test/test_computeMatrixOperations.py
++++ python-deeptools/deeptools/test/test_computeMatrixOperations.py
+@@ -20,7 +20,7 @@
+ 
+ 
+ class TestComputeMatrixOperations(object):
+-    def setUp(self):
++    def setup(self):
+         self.root = ROOT
+         self.matrix = self.root + "computeMatrixOperations.mat.gz"
+         self.bed = self.root + "computeMatrixOperations.bed"
+--- python-deeptools.orig/deeptools/test/test_countReadsPerBin.py
++++ python-deeptools/deeptools/test/test_countReadsPerBin.py
+@@ -12,7 +12,7 @@
+ 
+ class TestCountReadsPerBin(object):
+ 
+-    def setUp(self):
++    def setup(self):
+         """
+         The distribution of reads between the two bam files is as follows.
+ 
+@@ -195,7 +195,7 @@
+ 
+ 
+ class TestCountReadsPerBinCRAM(TestCountReadsPerBin):
+-    def setUp(self):
++    def setup(self):
+         """
+         As above, but using CRAM rather than BAM
+         The distribution of reads between the two bam files is as follows.


=====================================
debian/patches/series
=====================================
@@ -1,2 +1,3 @@
 tmp_inhibit_test_readFiltering.patch
 python2to3_for_executables.patch
+pytest.patch


=====================================
debian/rules
=====================================
@@ -8,7 +8,7 @@ export PYBUILD_NAME=deeptools
 
 override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-	PYTHONPATH=$(CURDIR) nosetests3 -x -v -s deeptools
+	PYTHONPATH=$(CURDIR) pytest-3 -v deeptools
 endif
 
 override_dh_auto_clean:


=====================================
debian/tests/control
=====================================
@@ -1,3 +1,3 @@
 Tests: run-unit-test
-Depends: @, python3-nose
+Depends: @, python3-pytest
 Restrictions: allow-stderr


=====================================
debian/tests/run-unit-test
=====================================
@@ -2,5 +2,5 @@
 set -e
 for py in $(py3versions -r 2> /dev/null)
 do echo "Testing with $py in $(pwd):"
-    nosetests3 -v -s deeptools
+    pytest-3 -v deeptools
 done



View it on GitLab: https://salsa.debian.org/med-team/python-deeptools/-/compare/58900abc167f92df4d53253158ccfdab77c4127c...d0a6e6eaf09e0fda3a6f12e0cf8f25ba9fa0d137

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-deeptools/-/compare/58900abc167f92df4d53253158ccfdab77c4127c...d0a6e6eaf09e0fda3a6f12e0cf8f25ba9fa0d137
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20221202/0a56eff9/attachment-0001.htm>


More information about the debian-med-commit mailing list