File: remove-nose.patch

package info (click to toggle)
python-hdf5storage 0.1.19-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 896 kB
  • sloc: python: 3,504; makefile: 132
file content (87 lines) | stat: -rw-r--r-- 2,220 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
--- a/tests/test_hdf5_filters.py
+++ b/tests/test_hdf5_filters.py
@@ -32,7 +32,6 @@
 
 import hdf5storage
 
-from nose.tools import raises
 
 from asserts import *
 from make_randoms import *
--- a/tests/test_string_utf16_conversion.py
+++ b/tests/test_string_utf16_conversion.py
@@ -36,7 +36,6 @@
 
 import hdf5storage
 
-import nose.tools
 
 
 # A test to make sure that the following are written as UTF-16
@@ -59,7 +58,7 @@
                           store_python_metadata=False,
                           convert_numpy_str_to_utf16=True)
         with h5py.File(filename, mode='r') as f:
-            nose.tools.assert_equal(f[name].dtype.type, np.uint16)
+            assert f[name].dtype.type == np.uint16
     except:
         raise
     finally:
--- a/tests/test_matlab_compatibility.py
+++ b/tests/test_matlab_compatibility.py
@@ -28,7 +28,6 @@
 import os.path
 import subprocess
 
-from nose.plugins.skip import SkipTest
 
 import hdf5storage
 
@@ -85,7 +84,7 @@
 
 def test_read_from_matlab():
     if not ran_matlab_successful[0]:
-        raise SkipTest
+        return
     for k in (set(types_v7.keys()) - set(['__version__', '__header__', \
             '__globals__'])):
         yield check_variable_from_matlab, k
@@ -93,7 +92,7 @@
 
 def test_to_matlab_back():
     if not ran_matlab_successful[0]:
-        raise SkipTest
+        return
     for k in set(types_v7p3.keys()):
         yield check_variable_to_matlab_back, k
 
--- a/tests/test_write_readback.py
+++ b/tests/test_write_readback.py
@@ -37,7 +37,26 @@
 
 import hdf5storage
 
-from nose.tools import raises
+from functools import wraps
+
+def raises(*exceptions):
+    valid = ' or '.join([e.__name__ for e in exceptions])
+
+    def decorate(func):
+        name = func.__name__
+        def newfunc(*arg, **kw):
+            try:
+                func(*arg, **kw)
+            except exceptions:
+                pass
+            except:
+                raise
+            else:
+                message = "%s() did not raise %s" % (name, valid)
+                raise AssertionError(message)
+        newfunc = wraps(func)(newfunc)
+        return newfunc
+    return decorate
 
 from asserts import *
 from make_randoms import *