Fixes to `utils.testing` import functions

- Added `utils.compat` with helper functions
  for proper type checking
- Simplified many type checks throughout the code
- Documentation changes to test import functions
Test module search now uses `os.walk`

- also fixed an unused variable flake8 warning