old_contents: try:
      import unittest2 as unittest
  except ImportError:
      import unittest
  
  from mock import patch
  
  
  class TestUnsupportedFamily(unittest.TestCase):
  
      def test_unsupported_system(self):
  
          from fabtools.system import UnsupportedFamily
  
          with self.assertRaises(UnsupportedFamily) as cm:
  
              with patch('fabtools.system.distrib_id') as mock_distrib_id:
                  mock_distrib_id.return_value = 'foo'
  
                  raise UnsupportedFamily(supported=['debian', 'redhat'])
  
          exception_msg = str(cm.exception)
          self.assertEquals(exception_msg, "Unsupported system foo (supported families: debian, redhat)")
  
new_contents: from mock import patch
  
  import pytest
  
  
  def test_unsupported_system():
  
      from fabtools.system import UnsupportedFamily
  
      with pytest.raises(UnsupportedFamily) as excinfo:
  
          with patch('fabtools.system.distrib_id') as mock_distrib_id:
              mock_distrib_id.return_value = 'foo'
  
              raise UnsupportedFamily(supported=['debian', 'redhat'])
  
      exception_msg = str(excinfo.value)
      assert exception_msg == "Unsupported system foo (supported families: debian, redhat)"
  
subject: fix Python 2.6 compatibility