old_contents: import unittest
  
  if __name__ == '__main__':
      all_tests = unittest.TestLoader().discover('./', pattern='*_tests.py')
      unittest.TextTestRunner().run(all_tests)
  
new_contents: import sys
  import unittest
  
  if __name__ == '__main__':
      all_tests = unittest.TestLoader().discover('./', pattern='*_tests.py')
      ret = unittest.TextTestRunner().run(all_tests)
      sys.exit(not ret.wasSuccessful())
  
subject: Fix an issue when unit tests always return 0 status.