运行测试

60.3 运行测试

命令行:python -m unittest test_module.py

或在文件末尾 unittest.main()

  • 测试文件建议以 test_ 开头
  • 一个功能可写多个 test_ 方法