fixed test failure

make array containing nans compare equal
close test files (silence a warning on Python3)