File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -423,6 +423,13 @@ def assert_arr_dict_equal(dict1, dict2):
423
423
assert_array_equal (value1 , value2 )
424
424
425
425
426
+ def assert_structarr_equal (star1 , star2 ):
427
+ # Compare structured arrays (array_equal does not work for np 1.5)
428
+ assert_equal (star1 .dtype , star2 .dtype )
429
+ for name in star1 .dtype .names :
430
+ assert_array_equal (star1 [name ], star2 [name ])
431
+
432
+
426
433
def test_header_copy ():
427
434
# Test header copying
428
435
hdr = PARRECHeader (HDR_INFO , HDR_DEFS )
@@ -434,7 +441,7 @@ def assert_copy_ok(hdr1, hdr2):
434
441
assert_false (hdr1 .general_info is hdr2 .general_info )
435
442
assert_arr_dict_equal (hdr1 .general_info , hdr2 .general_info )
436
443
assert_false (hdr1 .image_defs is hdr2 .image_defs )
437
- assert_array_equal (hdr1 .image_defs , hdr2 .image_defs )
444
+ assert_structarr_equal (hdr1 .image_defs , hdr2 .image_defs )
438
445
439
446
assert_copy_ok (hdr , hdr2 )
440
447
assert_false (hdr .permit_truncated )
You can’t perform that action at this time.
0 commit comments