PyTest
summary
Shows how to use pytest from installation to diagnosis: install with pip install pytest (inside virtualenv), write plain assert tests, run selected cases with pytest file.py::test_name, and inspect rich failures where pytest pinpoints differing chars, list items or dict keys. Demonstrates marking flaky bugs with @pytest.mark.xfail(reason="bug id"), skipping with skip/skipif, flags (-s to show stdout, -q, -x, --maxfail), and simple fixtures like tmpdir for isolated file-system tests.
AI-written summary · about
chapters (13)
- 0:00Introduction to PyTest
- 1:49Testing methodologies overview
- 3:16Writing first PyTest
- 6:26Handling failing tests
- 8:54Running single failing tests
- 10:20Marking expected failures
- 13:33Skipping tests conditionally
- 16:43PyTest reporting flags
- 18:34Advanced assertion reporting
- 21:02Handling multiple test failures
- 23:09Introduction to fixtures
- 25:15Using temp directories in tests
- 26:18PyTest resources and summary
related talks
32mpytest for unittesters
27mWhy I use py.test and maybe you should too
33mUnit Testing with Pytest
03h 02mdef test_crash_course_with_pytest()
21mDon't just test, my friend, test better
30mVisual Testing with PyCharm and pytest
38mTesting for the Terrified: How to Write Tests, Conquer Guilt, and Level Up
30mHow to build a unit testing library from scratch?
