old_contents: import unittest
  import sys
  import os
  
  sys.path.insert(0, os.path.dirname(__file__))
  
  if __name__ == "__main__":
      all_tests = unittest.TestLoader().discover('./tests')
      unittest.TextTestRunner().run(all_tests)
  
new_contents: import unittest
  import sys
  import os
  
  sys.path.insert(0, os.path.dirname(__file__))
  
  if __name__ == "__main__":
      all_tests = unittest.TestLoader().discover('./tests')
      result = unittest.TextTestRunner().run(all_tests)
      sys.exit(not result.wasSuccessful())
  
subject: Fix runtests.py to return non-zero exit code on test failure