Create clean/blank MacOS fs on MacOS or Linux
I don't think you can containerize MacOS, but you could create a Mac OS VM and snapshot it, that way you can easily restore to the same exact Mac OS version for each test.