AFM-SPM / TopoStats

An AFM image analysis program to batch process data and obtain statistics from images
https://afm-spm.github.io/TopoStats/
GNU Lesser General Public License v3.0
60 stars 11 forks source link

Running tests modifies files under tests/resources/tracing/nodestats #950

Closed ns-rse closed 1 month ago

ns-rse commented 1 month ago

I've found that running the tests on `maxgamill-sheffield/800-better-tracing results in the following files being modified...

modified   tests/resources/tracing/nodestats/catenanes_nodestats_data.pkl (binary)
modified   tests/resources/tracing/nodestats/rep_int_nodestats_data_no_pair_odd_branches.pkl (binary)
modified   tests/resources/tracing/nodestats/rep_int_nodestats_data_pair_odd_branches.pkl (binary)

As these are part of the test suite Git then tells us that they have been modified and these need handling reverting each and every time.

It would be preferable if these files, which I think are written to disk then read back in to check they have the correct format by one of the tests under tests/tracing/test_nodestats.py were written to the temporary directory that pytest uses which I think from memory is tmppath.

This shouldn't be too big a fix and should ideally be merged into maxgamill-sheffield/800-better-tracing (#800) before that is merged to main (as it is an artifact of the tests that have been introduced in this development branch).

SylviaWhittle commented 1 month ago

They aren't meant to be saved then loaded, the script for updating the test was just still active (erroneously).

I've now fixed this.

image

This was just me forgetting to turn off the test update script. Not ideal ofc, alternative method for updating tests being explored in #913