@after.each_scenario
def stop_stubs(_scenario):
 for name in SERVICES.keys():
  stub_server = getattr(world, name, None)
  if (stub_server is not None):
   stub_server.shutdown()

@ after . each_scenario def stop_stubs ( _scenario ) : for name in SERVICES . keys ( ) : stub_server = getattr ( world , name , None ) if ( stub_server is not None ) : stub_server . shutdown ( )
shut down any stub services that were started up for the scenario .