This happends in the test_schedulers.py where the job submission should be wrapped in a:
with rt.module_use(test_util.TEST_MODULES):
This can be easily reproduced by executing the test_submit[slurm] test and looking at the stderr where the testmod_foo cannot be found.