I have been unable to find any existing repositories or modules for building fixtures and doing unit testing for ArcGIS. I don't think this is a part of computer science that GIS has fully embraced,

Are there any existing tools or python modules for building fixtures/mocking up spatial data/unit testing for Arc?

I know that mock can be used to create anything, but curious to see if there is anything preexisting.

a few resources I was able to find: https://notesfromthelifeboat.com/post/testing-arcpy-1/ https://notesfromthelifeboat.com/post/testing-arcpy-2/

And some of the related code here from the author: https://github.com/lobsteropteryx/testing-arcpy

  • I'm curious: are you wanting to write unittests for core ArcGIS functionality? If so, why? Maybe I'm missing some obvious point, but they'd only be necessary to run whenever you upgrade the software (how often do you do that?).
    – KHibma
    Jun 12, 2020 at 18:19
  • I agree that would be silly, perhaps "integration tests" would be a better phrase to use, but conceptually, if I write a function and want to use it to update something in a cursor, or in Field Calculator as part of a large process, I would want to run unit-tests before implementing it into a process to double check that it would say handle NULL/None or special characters. @Khibma
    – bwp8nt
    Jun 13, 2020 at 0:30


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.