https://stackoverflow.com/questions/36834677/print-success-messages-for-asserts-in-python

总结

class BasicTestCase(unittest.TestCase):

    def test_index(self):
        """Initial test: Ensure flask was set up correctly."""
        tester = app.app.test_client(self)
        response = tester.get('/', content_type='html/text')
        self.assertEqual(response.status_code, 200)
        print('test_index success!')

在assert后加上print

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2021-11-20
  • 2021-11-03
猜你喜欢
  • 2021-11-20
  • 2022-01-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
  • 2021-11-09
相关资源
相似解决方案