old_contents: import os
  import glob
  import json
  import pprint
  import botocore.session
  from botocore.response import XmlResponse
  
  
  def check_dicts(d1, d2):
      if d1 != d2:
          pprint.pprint(d1)
          print('-' * 40)
          pprint.pprint(d2)
      assert d1 == d2
  
  
  def test_response_parsing():
      data_path = os.path.dirname(os.path.join(os.path.abspath(__file__)))
      data_path = os.path.join(data_path, 'data')
      session = botocore.session.get_session()
      xml_files = glob.glob('%s/*.xml' % data_path)
      service_names = set()
      for fn in xml_files:
          service_names.add(os.path.split(fn)[1].split('-')[0])
      for service_name in service_names:
          service = session.get_service(service_name)
          service_xml_files = glob.glob('%s/%s-*.xml' % (data_path, service_name))
          for xmlfile in service_xml_files:
              dirname, filename = os.path.split(xmlfile)
              basename = os.path.splitext(filename)[0]
              jsonfile = os.path.join(dirname, basename + '.json')
              sn, opname = basename.split('-', 1)
              operation = service.get_operation(opname)
              r = XmlResponse(operation)
              fp = open(xmlfile)
              xml = fp.read()
              fp.close()
              r.parse(xml)
              fp = open(jsonfile)
              data = json.load(fp)
              fp.close()
              check_dicts.description = basename
              yield check_dicts, r.get_value(), data
  
  
  if __name__ == '__main__':
      test_all()
  
new_contents: import os
  import glob
  import json
  import pprint
  import botocore.session
  from botocore.response import XmlResponse
  
  
  def check_dicts(d1, d2):
      if d1 != d2:
          pprint.pprint(d1)
          print('-' * 40)
          pprint.pprint(d2)
      assert d1 == d2
  
  
  def test_response_parsing():
      data_path = os.path.join(os.path.dirname(__file__), 'data')
      session = botocore.session.get_session()
      xml_files = glob.glob('%s/*.xml' % data_path)
      service_names = set()
      for fn in xml_files:
          service_names.add(os.path.split(fn)[1].split('-')[0])
      for service_name in service_names:
          service = session.get_service(service_name)
          service_xml_files = glob.glob('%s/%s-*.xml' % (data_path, service_name))
          for xmlfile in service_xml_files:
              dirname, filename = os.path.split(xmlfile)
              basename = os.path.splitext(filename)[0]
              jsonfile = os.path.join(dirname, basename + '.json')
              sn, opname = basename.split('-', 1)
              operation = service.get_operation(opname)
              r = XmlResponse(operation)
              fp = open(xmlfile)
              xml = fp.read()
              fp.close()
              r.parse(xml)
              fp = open(jsonfile)
              data = json.load(fp)
              fp.close()
              check_dicts.description = basename
              yield check_dicts, r.get_value(), data
  
  
  if __name__ == '__main__':
      test_all()
  
subject: Remove use of abspath for nose generator.