I am writing a unit test. The thing it tests involves numpy memmaps, which, like numpy ndarrays, can be "views" that reference an other memmap's data (and take no time to create) or copies (which take a long time to create).
I want to test how many copy-type memmaps are created inside my function and ensure it is minimized given certain inputs. Is this possible?