standard KeyError pattern 

try:
  injection = injection[name]
except KeyError:
  injection = Mock()