恭喜你!

Python 测试入门

Alexander Levin

Data Scientist

第 1 章——用 pytest 创建测试

  • 测试与 pytest
  • 命令行:pytest test_script.py
  • 测试标记(markers)

测试输出示例

Python 测试入门

第 2 章——Pytest fixtures

  • fixture 简介
  • 串联 fixture 请求 fixture 调用其他 fixture

  • 自动使用(autouse)fixture

  • fixture 的清理(teardown)
Python 测试入门

第 3 章——基础测试类型

  • 单元测试
  • 功能测试
  • 集成测试
  • 性能测试
Python 测试入门

第 4 章——用 unittest 编写测试

  • 认识 unittest
    import unittest
    class TestSquared(unittest.TestCase):
      def test_negative(self):
          self.assertEqual((-3) ** 2, 9)
    
  • unittest 命令行 unittest test_sqneg.py 的输出

  • unittest 中的 fixtures

  • 实用示例
Python 测试入门

恭喜你!

Python 测试入门

Preparing Video For Download...