File: nose2.patch

package info (click to toggle)
python-seqcluster 1.2.9%2Bds-3
  • links: PTS, VCS
  • area: contrib
  • in suites: bookworm
  • size: 113,624 kB
  • sloc: python: 5,308; makefile: 184; sh: 122; javascript: 55
file content (125 lines) | stat: -rw-r--r-- 3,621 bytes parent folder | download | duplicates (2)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
--- a/test/test_automated_analysis.py
+++ b/test/test_automated_analysis.py
@@ -11,8 +11,7 @@
 import collections
 import functools
 
-from nose import SkipTest
-from nose.plugins.attrib import attr
+#from nose2 import SkipTest
 import yaml
 
 
@@ -31,19 +30,19 @@
     finally:
         os.chdir(orig_dir)
 
-def expected_failure(test):
-    """Small decorator to mark tests as expected failure.
-    Useful for tests that are work-in-progress.
-    """
-    @functools.wraps(test)
-    def inner(*args, **kwargs):
-        try:
-            test(*args, **kwargs)
-        except Exception:
-            raise SkipTest
-        else:
-            raise AssertionError('Failure expected')
-    return inner
+#def expected_failure(test):
+#    """Small decorator to mark tests as expected failure.
+#    Useful for tests that are work-in-progress.
+#    """
+#    @functools.wraps(test)
+#    def inner(*args, **kwargs):
+#        try:
+#            test(*args, **kwargs)
+#        except Exception:
+#            raise SkipTest
+#        else:
+#            raise AssertionError('Failure expected')
+#    return inner
 
 class AutomatedAnalysisTest(unittest.TestCase):
     """Setup a full automated analysis and run the pipeline.
@@ -65,8 +64,6 @@
         shutil.move(os.path.basename(dirname), dirname)
         os.remove(os.path.basename(url))
 
-    @attr(complete=True)
-    @attr(cluster=True)
     def test_srnaseq_cluster(self):
         """Run cluster analysis
         """
@@ -88,8 +85,9 @@
             print(" ".join(cl))
             subprocess.check_call(cl)
 
-    @attr(complete=True)
-    @attr(miraligner=True)
+    test_srnaseq_cluster.complete = True
+    test_srnaseq_cluster.cluster = True
+
     def test_srnaseq_miraligner(self):
         """Run miraligner analysis
         """
@@ -105,3 +103,5 @@
                   "../../data/examples/miraligner/sim_isomir.fa"]
             print(" ".join(cl))
             # subprocess.check_call(cl)
+    test_srnaseq_miraligner.complete = True
+    test_srnaseq_miraligner.miraligner = True
--- a/test/test_database.py
+++ b/test/test_database.py
@@ -11,7 +11,6 @@
 from seqcluster.libs.read import load_data
 from seqcluster.db import make_database
 from seqcluster.libs.logger import initialize_logger
-from nose.plugins.attrib import attr
 
 @contextlib.contextmanager
 def make_workdir():
@@ -30,7 +29,6 @@
 
 
 class TestDatabase(TestCase):
-    @attr(database=True)
     def test_database(self):
         if find_cmd("sqlite3"):
             with make_workdir() as workdir:
@@ -44,3 +42,4 @@
                 logger.info("Create database")
                 make_database(data)
         # self.assertTrue()
+    test_database.database = True
--- a/test/test_preparedata.py
+++ b/test/test_preparedata.py
@@ -5,11 +5,9 @@
 import inspect
 from seqcluster.prepare_data import _read_fastq_files, _create_matrix_uniq_seq
 import seqcluster
-from nose.plugins.attrib import attr
 
 
 class TestPreparedata(TestCase):
-    @attr(collapse=True)
     def test_preparedata(self):
         out_dir = "test/test_out_prepare"
         if os.path.exists(out_dir):
@@ -26,7 +24,8 @@
         if os.path.exists(out_dir):
             shutil.rmtree(out_dir)
 
-    @attr(umis=True)
+    test_preparedata.collapse = True
+
     def test_umis(self):
         from seqcluster.libs.fastq import collapse, write_output
         umis = collapse(os.path.abspath("data/examples/umis/sample.fastq"))
@@ -37,3 +36,5 @@
             shutil.rmtree(out_dir)
         os.mkdir(out_dir)
         write_output(os.path.join(out_dir, "umis.fastq"), umis)
+
+    test_umis.umis = True