Python Testing Fundamentals
summary
Covers concrete examples: assert statements as reality checks (shows BigBiz bottom_line/growth returning -1,000,000, triggering AssertionError) and that assertions disable with the -O switch; demonstrates unittest: subclassing TestCase, setUp/tearDown, TestSuite selection and discovery, running tests via setup.py; shows doctest examples (Fibonacci and triangular functions, tests for <100 and <10), and converting doctests into unit tests with doctest.DocTestSuite; all demo tests run and pass (4 tests, 0 failures) on Python 3.2.3.
AI-written summary · about
chapters (14)
- 0:00Introduction to testing
- 3:50Why you should test
- 5:54Using assert statements
- 10:15Practical assertion examples
- 14:58Disabling assertions
- 18:18Unit test fundamentals
- 22:47Writing test cases
- 25:28Test fixtures and suites
- 50:29Advanced test suites
- 56:12Test discovery and setup
- 1:07:36Introduction to doc tests
- 1:09:25Running doc tests
- 1:15:38Integrating doc and unit tests
- 1:20:22Test driven development
related talks
41mTesting is Fun in Python!
35mTesting: Choose Your Weapons
33mUnit Testing with Pytest
01h 23mIntroduction to Property-Based Testing
17mTest! (Some OF) Your! Code!: How To Write...
03h 02mdef test_crash_course_with_pytest()
38mTesting for the Terrified: How to Write Tests, Conquer Guilt, and Level Up
01h 07mSufficiently Advanced Testing
