Author: Maciej Fijalkowski <[email protected]>
Branch: numpy-record-dtypes
Changeset: r52258:e16a35f9d150
Date: 2012-02-08 23:04 +0200
http://bitbucket.org/pypy/pypy/changeset/e16a35f9d150/

Log:    what's not tested is broken

diff --git a/pypy/module/micronumpy/interp_dtype.py 
b/pypy/module/micronumpy/interp_dtype.py
--- a/pypy/module/micronumpy/interp_dtype.py
+++ b/pypy/module/micronumpy/interp_dtype.py
@@ -103,7 +103,7 @@
         return space.newtuple([space.wrap(name) for name in self.fieldnames])
 
     @unwrap_spec(item=str)
-    def descr_getitem(self, item):
+    def descr_getitem(self, space, item):
         if self.fields is None:
             raise OperationError(space.w_KeyError, space.wrap("There are no 
keys in dtypes %s" % self.name))
         try:
diff --git a/pypy/module/micronumpy/test/test_dtypes.py 
b/pypy/module/micronumpy/test/test_dtypes.py
--- a/pypy/module/micronumpy/test/test_dtypes.py
+++ b/pypy/module/micronumpy/test/test_dtypes.py
@@ -14,7 +14,9 @@
         assert dtype(None) is dtype(float)
         assert dtype('int8').name == 'int8'
         assert dtype(int).fields is None
+        assert dtype(int).names is None
         raises(TypeError, dtype, 1042)
+        raises(KeyError, 'dtype(int)["asdasd"]')
 
     def test_dtype_eq(self):
         from _numpypy import dtype
@@ -472,4 +474,5 @@
         assert d.type is void
         assert d.char == 'V'
         assert d.names == ("x", "y", "z", "value")
-        
+        raises(KeyError, 'd["xyz"]')
+        raises(KeyError, 'd.fields["xyz"]')
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to