GraphBLAS / LAGraph

This is a library plus a test harness for collecting algorithms that use the GraphBLAS. For test coverage reports, see https://graphblas.org/LAGraph/ . Documentation: https://lagraph.readthedocs.org
Other
225 stars 59 forks source link

Change test_MMRead to not modify data #207

Closed moonwatcher closed 1 year ago

moonwatcher commented 1 year ago

test_MMRead contains a subtest that (strangely) test MMWrite. That test seems to modify the comments.txt and comments_*.mtx files. At the end of test_MMRead those files go back to how they were checked into the repository but that means that a failure in test_MMRead can drag on ghost failures in other tests (specifically observed in test_minmax). If test_MMRead passes all is well, but if it doesn't it can be pretty weird...

This PR changes the test to write to temp files, opened r/w with tmpfile() and rewinded instead of opened separately for write then read.

The total effect is not changing the data directory and remove this spurious effect.